Nero said:
thank you ever so much it works like a charm.
The solution posted by Gary Walters is the better way to go because it is a
more efficient query design. If you have an index on your date field Gary's
criteria will be able to utilize it whereas the other posted solution will
have to do a fiull table scan.
Not a big deal if the table is small and local, but could make a big
difference in larger networked tables. The rule of thumb is to never set
criteria against an expression if there is an alternative that lets you set
criteria directly against the field. As soon as you test against an
expression the query engine can no longer use any indexes. The problem is
that the less efficient methods are often easier to conceptualize and take
fewer keystrokes to implement so you see them used a lot.
Having an expression in the actual criteria (the right-hand side of the
expression) is fine as long as it does not contain references to other
fields.