A date includes a date, month, and year. While you could use the format
command to format the field and criteria the same, it would return the month
and day, regardless of year. This will probably cause you a problem when you
continue to add records next year. The criteria will work properly if you
include the year also. If you simply want the current year, you can
concatenate that in.
Select intHours from T_Test where DateSerial(Year(Date()), 05, 25) between
dtmStartDate and dtmEndDate
--
Wayne Morgan
Microsoft Access MVP
"Alain Filiatrault" <al****@humaprise.com> wrote in message
news:45**************************@posting.google.c om...
HI,
I'm having a problem with the following query.
Here it is in my own words :
Table :
T_Test
id (Autonumber)
dtmStartDate (Datetime) format dd-mm
dtmEndDate (datetime) format dd-mm
intHours (number)
I want to query the T_Test table with a dd-mm value to get the right
intHours value where my dd-mm is between dtmStartDate and dtmEndDate.
Select intHours from T_Test where '25-05' between dtmStartDate and
dtmEndDate
Can someone help please?
Thanks
Alain