View Full Version : Setting Criteria for multiple Min-Max fields and OR with similar criteria


cft
04-16-2002, 02:03 PM
I am confused by the apparent limitations on search criteria for multiple fields using "between_and_". I have a table with 10 fields. Standard fields with customer information, DATE, Amount, Carrier, Zip Code,etc. I am able to query successfully when I use DATE criteria Month[Enter Month as Digit] and Year[Enter Year as yyyy], and have added for $Amount "Between [Enter Minimum Range]and[Enter Maximum Range]". The problem arises when I try to query based solely on the DATE criteria. I have added the DATE criteria seperately on the following OR line, but the query seems to demand the $Amount to be selected. I thought that OR meant "in lieu of" the full set of criteria on the first line and would allow a search based on other criteria if on another line. I want to be able to search by DATE and any or all other fields, and any other of the 5 plus one, two or more of the others. I know that there are limits to the number of OR lines, but how do they operate? Am I way off base with this one?

Pat Hartman
04-16-2002, 02:39 PM
Access date/time fields store serial numbers representing the number of days from an origin date. If you simply prompt for a month and year, you will need to convert that to mm/01/yyyy for the first day of a month and to mm/ll/yyyy for the last day of a month where ll is calculated based on month and year. If you want to compare two text date fields, you need to have the component parts in year,month,day order.

Offhand I don't know what the limit is for OR lines but as help explains them, think of them as parallel lines in a race track. Every criteria on a single line is connected with others of the same line with the AND relatinal operator. Individual lines are connected with the OR operator. So

A and B and C
OR
A and D and E

cft
04-17-2002, 01:58 PM
Thank you Pat - I decided to take a different strategy that made my life a lot easier. I am using a form with command buttons to call separate queries via macros. This is "cleaner" than what I was attempting to achieve via a "do-all" query set up. Thanks for the education, however. I am learning quite a bit about what I can and cannot do, or think I cannot but can, or....etc... Thanks again!