convert month text (MAR) to month number (3)

  • Follow


I am trying to work with a data set that unfortunately has spit out all the
dates in a text format - i.e. 03/01/2009 is MAR 3 2009.

Is there a way to convert that text date to an actual date format?

Any advice or suggestions are greatly appreciated.

Thanks

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/200912/1

0
Reply HLCruz 12/10/2009 7:59:02 PM

Debug.Print CDate("MAR 3 2009") = 3/3/2009

One problem with the CDate function is that it will bomb out on things that 
can't be evaluated as a date. Therefore you may want to use the IsDate 
function first. Something like this will work in a query. If it can't be 
evaluated as a date, it returns a bogus 1/1/1950 date. You could change this 
to a more bogus date if that would help find them. Remember to change the 
YourDateField to the actual name of your field.

TheDate: IIf(IsDate([YourDateField])=True,Cdate([YourDateField]),#1/1/1950#) 
-- 
Jerry Whittle, Microsoft Access MVP 
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"HLCruz via AccessMonster.com" wrote:

> I am trying to work with a data set that unfortunately has spit out all the
> dates in a text format - i.e. 03/01/2009 is MAR 3 2009.
> 
> Is there a way to convert that text date to an actual date format?
> 
> Any advice or suggestions are greatly appreciated.
> 
> Thanks
0
Reply Utf 12/10/2009 9:00:01 PM


1 Replies
626 Views

(page loaded in 1.379 seconds)

Similiar Articles:
















7/23/2012 7:50:34 AM


Reply: