CJ: basically i have a simple table of fields :
wkday is the query name heres the sql for it:
SELECT emphrs.*, emphrs.dte, emphrs.emp
FROM emphrs
WHERE (((emphrs.emp)=forms!CalendarAnnual!Text105.value) And ((Weekday([dte],1))=1) And ((Month([dte]))=Month(Now())));
emphrs is the table name
dte:date -ie 11/11/2013
emphrs:hours -ie 4
bs

rder number - ie bs12345
emp:employee - ie fred
the query you helped me with sorts out only a given day each week during the current month. like only show mondays in current month.
i have a calendar which populates from the sql code. getting values from the query
which is:
strSQL = "SELECT wkday.emphrs.dte,wkday.emphrs.emp,wkday.emphrs.bs,wkday. emphrs.hrs "
strSQL = strSQL & "FROM wkday "
strSQL = strSQL & "WHERE (wkday.emphrs.dte) Between " & lngFirstOfMonth & " And " & lngLastOfMonth & " ORDER BY "
strSQL = strSQL & "wkday.emphrs.dte;"
Debug.Print strSQL
Set rstEvents = db.OpenRecordset(strSQL) fails here (with too few parameters 1)
note : lngFirstOfMonth is a serilized date so is lngLastOfMonth
but if i run the sql in a query no error comes up.
i know its due to the query has parameters from the where clauses.
for a fact if i change the sql to
SELECT emphrs.*, emphrs.dte, emphrs.emp From emphrs WHERE ((emphrs.emp)= "Fred astaire") And (Weekday([emphrs.dte], 1) = 1) And (Month([emphrs.dte])) = Month(Now());
i get an error 13 type mismatch but where is the mismatch
the emp name or is it the dates