View Full Version : Criteria huh....


elgoober
05-30-2002, 11:30 AM
Chaps

Have a table that records (instead of dates) week no's and day no's.(1 to 5) Need a query that says get me weeks between 14 and 18 (no problem) and week days 1 -5 for weeks 14 to 17 and day 1- 3 for week 18. (I realise I should have used dates but...)

Any suggestions gratefully received

Paul

vangogh228
05-30-2002, 11:37 AM
In the first criteria line of your query:
Under Week # : Between 14 and 17
Under Day # : Between 1 and 5

In the second criteria line (the first OR line):
Under Week # : Like 18
Under Day # : Between 1 and 3

elgoober
05-30-2002, 12:50 PM
Cheers

Paul

RichMorrison
05-30-2002, 12:50 PM
Yes, you should have used dates http://www.access-programmers.co.uk/ubb/smile.gif

I used to deal with a similar problem by dynamically generating a table of all week/day values in the "from" and "to" range (14-1, 14-2,,,,18-3). A join to the primary table on week and day would then select all the records in the range.

A sloppy but reusable method.

Eventually we converted all activity records to a real date and used a lookup table that converted week/day to m/d/yyyy. The users could still use the familiar week/day notation and the queries could use "Between StartDate and EndDate".

HTH,
RichM