Another query query!

pholligan

Registered User.
Local time
Today, 12:54
Joined
Jan 20, 2003
Messages
19
Hi again!

I am trying to sort records on a couple of fields which are Start Date and End Date. The user selects a month and a year using 2 combo boxes (see previous post), and I would like an expression which will do the following:

Show only records where
The end date is in the month and year selected OR
The start date is in the month selected but the end date isn't

I'm using Expr1: Format([Last day of sickness],"mmm/yy") to format the date.

and: [Forms]![PERIOD SELECT]![Combo0] & "/" & [Forms]![PERIOD SELECT]![Combo2] to get the Month and Year from the form.

All of this works fine but I can't see how to enter an expression which will satisfy the criteria stated above. Every attempt I have results in an error where the expression is too complex or wrong!

I will be very very greatful for any help, and hopefully with all of this advice I have recieved I may even be able to help someone else one day!

Thanks again
Paul
 
It was as simple as I thought, a couple of syntax errors at the start caused the errors!

The final statement was:
WHERE (((Format([Last day of sickness],"mmm/yy"))=[Forms]![PERIOD SELECT]![Combo0] & "/" & [Forms]![PERIOD SELECT]![Combo2])) OR (((Format([First Day of sickness],"mmm/yy"))=[Forms]![PERIOD SELECT]![Combo0] & "/" & [Forms]![PERIOD SELECT]![Combo2]));

Paul
 

Users who are viewing this thread

Back
Top Bottom