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

Searching for month

Status
Not open for further replies.

hays

Technical User
May 3, 2001
9
CA
In a subroutine I have the following code:

SQL = "select CALENDAR.DATE from CALENDAR where Format CALENDAR.DATE,'mmyyyy')=Format(" & desiredDate & ",'mmyyyy');"
Set daysOfMonth = db.OpenRecordset(SQL, dbOpenSnapshot)

where desiredDate is either "January 1, 2001" or 36892

This does not work. If, however, I replace " & desiredDate & " with date() I can get the current month's worth of dates into the recordSet. Why is this?
 
Try this.

SQL = "Select CALENDAR.DATE from CALENDAR where Format CALENDAR.DATE,'mmyyyy')='" + Format(desiredDate,"mmyyyy")+ "';" Terry
------------------------------------
Experience is the hardest kind of teacher. It gives you the test first, and the lesson afterward.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top