Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Conversion Query Help 2

Status
Not open for further replies.

eerich

IS-IT--Management
Joined
Nov 2, 2003
Messages
124
Location
US
I have a text field that I'm trying to convert to dates. The data is stored as mmm-yy, i.e., Jan-08, Dec-07, Nov-07, etc.

In trying to convert this I am not able to get the correct year. My query example is:

Select format(cdate([GLPeriod]), 'mm/yy') as GLP
From myTable;

The results will convert the month correctly, but all of the year values return as '08', e.g., 01/08, 12/08, 11/08.

Any help with how to get the year to be converted correctly?

Thanks
 
Code:
Cdate(Left(GLPeriod,3) & "/1/" & Right(GLPeriod,2))
 
Worked perfectly!

Thanks Golom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top