A Different Between Two Dates

G

Guest

I am trying to run a query in Access 2002 with criteria >=[StartDate] And
<=[EndDate]. The StartDate and EndDate refer to fields in a table giving
beginning and end of month dates together with months ie Month is January
2006, StartDate 01/01/2006, EndDate 31/01/06. I enter the month required
into a drop down list on main form and then run the query. I cannot get the
query to include records for either the first or last day of the month
I have tried to use Between / And because the StartDate and EndDates are
already entered into the table but this doesn't work either. What am I doing
wrong? Any help please.

mazbaz
 
O

OfficeDev18 via AccessMonster.com

I suspect that StartDate and EndDate are not Date data types. If they aren't,
try using CDate(StartDate) and CDate(EndDate)

By the way, where do you get the 'year' information, both in your criteria
and in your table?

Hope this helps,

Sam
I am trying to run a query in Access 2002 with criteria >=[StartDate] And
<=[EndDate]. The StartDate and EndDate refer to fields in a table giving
beginning and end of month dates together with months ie Month is January
2006, StartDate 01/01/2006, EndDate 31/01/06. I enter the month required
into a drop down list on main form and then run the query. I cannot get the
query to include records for either the first or last day of the month
I have tried to use Between / And because the StartDate and EndDates are
already entered into the table but this doesn't work either. What am I doing
wrong? Any help please.

mazbaz
 
G

Guest

If both EndDate and StartDate indicating on the same month, then filter one
of them using the month

Select * From TableName Where Month([StartDate]) = MonthFromCombo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top