I have a timesheet details table . I am trying to run the following query against it.
Expand|Select|Wrap|Line Numbers
- SELECT [timesheetdetails].[Timesheetid], [timesheetdetails].[Totalhours]
- FROM timesheetdetails
- WHERE Format([date],'dd/mm/yyyy') between '01/01/2007' and '01/12/2007';
Very strangely, the lower condition works. For example, if I change the query to
Expand|Select|Wrap|Line Numbers
- SELECT [timesheetdetails].[Timesheetid], [timesheetdetails].[Totalhours]
- FROM timesheetdetails
- WHERE Format([date],'dd/mm/yyyy') >= '01/01/2007' ;
Expand|Select|Wrap|Line Numbers
- SELECT [timesheetdetails].[Timesheetid], [timesheetdetails].[Totalhours]
- FROM timesheetdetails
- WHERE Format([date],'dd/mm/yyyy') >= '01/01/2007' and
- Format([date],'dd/mm/yyyy') <= '01/01/2008' ;
Please help me. I need this urgently for a report. I have searched this site ad also the web for solutions. the syntax for the query is correct. why doesnt it work?
Thanks in advance
Nanda