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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert string to date 1

Status
Not open for further replies.

mflancour

MIS
Apr 23, 2002
379
US
I have a numeric month, a numeric year and I am concatinating them together to produce a date value. I need to filter this value using a between date and date. How can I do this? My first guess is to convert the string to a date value, but havn't had any luck yet. Tried Format(MyTable.MyDate,"mm/dd/yyyy") but didn't do a darn thing.
 
is that a function for access 2003 queries? it dosn't seem to recognize it
 
Yes, it's in Access 2003. How are you calling it, via a Query?
 
got the function to work, but it still sees teh value as a string even with the function.
 
I forgot that you only have a month and a year. You can try putting in "01" for the day to make it a complete date.
 
ya, I have it that way now concatinating cdate(month & "/01/" & year)... and it still reads as a string
 
SELECT CDate([Month] & "/01/" & [year]) AS Expr3
FROM dbo_SalesAnalysis_T
WHERE (((CDate([Month] & "/01/" & [year]))>1/1/2006));
 
Try putting the "#" symbol around the date parameter...

> #1/1/2006#
 
haha, sweet. Looks like that was the final trick. strange thought that should be automatic. Thanks a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top