Hi, This is part of a rather long inherited code.
This Sql statement works. It produces Weekend dates that are used for graphing:
stSqlWkEnd = "SELECT DISTINCT [date]+7-Weekday([date]) AS WkEnd, tblDailyRpts.Mhrs, " & _
"tblDailyRpts.SuSysID, tblDailyRpts.ItemType " & _
"From tblDailyRpts " & _
"WHERE (((tblDailyRpts.SuSysID) = [Forms]![frmPQSelDld]![txtSuSiD])) " & _
"ORDER BY [date]+7-Weekday([date]); "
Further down, rstWkEnd is defined as a Dynaset and I gather that this is to pick out the specific date fields from the sql statement above.
Set dbs = CurrentDb
Set rstWkEnd = dbs.OpenRecordset(stSqlWkEnd, dbOpenDynaset)
mWkEnd = rstWkEnd("WkEnd"
Do While Not rstWkEnd.EOF
At 'Set rstWkEnd', I get an error - Too Few Parameters. Expected - 1.
If I mouse over stSqlWkEnd, I see the sql statement - the data appears to be there.
rstWkEnd shows a blank date - 12:00 am
I am guessing that the Set rstWkend statement has a problem.
Can Someone help me out?
Thanks, Dan
This Sql statement works. It produces Weekend dates that are used for graphing:
stSqlWkEnd = "SELECT DISTINCT [date]+7-Weekday([date]) AS WkEnd, tblDailyRpts.Mhrs, " & _
"tblDailyRpts.SuSysID, tblDailyRpts.ItemType " & _
"From tblDailyRpts " & _
"WHERE (((tblDailyRpts.SuSysID) = [Forms]![frmPQSelDld]![txtSuSiD])) " & _
"ORDER BY [date]+7-Weekday([date]); "
Further down, rstWkEnd is defined as a Dynaset and I gather that this is to pick out the specific date fields from the sql statement above.
Set dbs = CurrentDb
Set rstWkEnd = dbs.OpenRecordset(stSqlWkEnd, dbOpenDynaset)
mWkEnd = rstWkEnd("WkEnd"
Do While Not rstWkEnd.EOF
At 'Set rstWkEnd', I get an error - Too Few Parameters. Expected - 1.
If I mouse over stSqlWkEnd, I see the sql statement - the data appears to be there.
rstWkEnd shows a blank date - 12:00 am
I am guessing that the Set rstWkend statement has a problem.
Can Someone help me out?
Thanks, Dan