All,
Trying to get a date WHERE statement to run to pull all records for the month. What I have is:
Dim SQL_Str, DatStr, MonVal
MonVal = Get_Month(TargetForm![cboxMON])
DatStr = MonVal & "/*/" & TargetForm![cboxYER]
SQL_Str = "SELECT * FROM qryREPrev WHERE ([tim_ted]= like #" & DatStr & "#)"
Set Wspace = DBEngine.Workspaces(0)
Set dbs = CurrentDb
Set rsS = dbs.OpenRecordset(SQL_Str, dbReadOnly)
and I get error when the OpenRecordSet executes.
Oh Date in the field "tim_ted" is in format "00/00/0000" and values coming from the screen are "TargetForm![cboxMON]" = long month name like "October" and "TargetForm![cboxYER]" = long year like "2009". Would also like to make my code generic enough to handle field of "00/00/00".
Is there a good Wildcard way to do this or is there another way?
OMR