Hello, I been trying to convert this sql to VBA but I keep getting an error "Syntax error in date query expression."
Can anyone help me on what syntax I need around the #yyyy# ?
Do I need to place anything around the field [Labordate]?
Thanks,
Jim
Code:
Set rsDays = CurDB.OpenRecordset( _
"SELECT tblhours.LaborDate, tblhours.tblEmployeeID, DatePart(#yyyy#,[labordate]) AS Expr1, tblhours.LaborHoursST" & _
" FROM tblHours" & _
" GROUP BY tblhours.LaborDate, tblhours.tblEmployeeID, DatePart(#yyyy#,[labordate]), tblhours.LaborHoursST" & _
"HAVING (((DatePart(#yyyy#,[labordate]))=DatePart(#yyyy#,Date())) AND ((tblhours.LaborHoursST)>0));")
Can anyone help me on what syntax I need around the #yyyy# ?
Do I need to place anything around the field [Labordate]?
Thanks,
Jim