Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Apr 2001
    Location
    Joliette, Quebec, Canada
    Posts
    290
    Thanks
    9
    Thanked 0 Times in 0 Posts

    date problem (2000)

    is there an easy way to convert a text variable with a value of "20000130" to a date variable in a 2000-jan-30 date format, in a query?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: date problem (2000)

    I don't know if there's an easier way but you could try this:

    Format(DateSerial(Left(YourDate,4), Mid(YourDate,5,2), Right(YourDate,2)), "yyyy-mmm-dd")

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: date problem (2000)

    Pat's suggestion will return a string that looks like a date.

    This will return an actual date:

    newDate: DateSerial(Left([YourDate],4),Mid([YourDate],5,2),Right([YourDate],2))

    You can display this date in any date format you like.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •