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

sql for adding records after 02/01 of current year

Status
Not open for further replies.
Oct 6, 2002
60
US
I hvae the following statement in a modual: "SELECT Count(InputID) AS TotDays FROM tblInput WHERE tblInput.InputDate > #" & Format("02/01/" & Str(Year(Date) - 1), "mm/dd/yy") & "# AND ((tblInput.UserID)=" & glngUserID & ")"for some reason, the 02/01/(current year) function is not being recognized as a date. Any help would be greatly appreciated.

Ryan
 
SQL always requires it's dates in US format - mm/dd/yy

If you use UK format normally, you need to manually convert the date for sql - you can create a custom format for it.



Like it? Star it!
 
Hi,

Actually, this may be more useful.

Code:
...& Format(CDate("02/01/" & Year(Date) - 1), "mm/dd/yy")) &...

Sorry, nearly time to go home!



Leigh Moore
Solutions 4 MS Office Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top