Re: query for tag renewal



Yes, I expect it would return all records, since you are comparing the field
to itself. I had intended for you to use the literal code I posted. Date()
is a function that returns the current date. DateAdd adds a specified date
interval to a date function or field (it can also be used to subtract a date
interval). By adding one month to today, March 12 you are getting the date
April 12. Therefore the criteria when you run the query today is:
Between March 12, 2007 and April 12, 2007
You will see all records with an expiration date in that range.

"Todd" <tak@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1462F37A-9816-4B55-8810-78B584E00CBA@xxxxxxxxxxxxxxxx
I created the query and in the tagexpiration field criteria I inserted the
following:

Between [tagexpiration] And DateAdd("m",1,[tagexpiration])

The above criteria gave me all tagexpirations in the table.

I'm assuming in the criteria you gave me I was suppose to enter the field
name where Date() was listed. Apparently, this was not correct?

When I entered the criteria as you provided I didn't get any records, I
made
sure there were records that had the tagexpiration date for at least
03/2007
and also 04/2007 but still no records returned.

The tagexpiration date is not a calculated field.

--
Todd


"BruceM" wrote:

I don't understand your question. You have a date field (I will call it
ExpDate). When you make a query based on the table containing ExpDate,
and
you put the criteria I provided into ExpDate, the query will return only
those records with an expiration date (that is, the date in the ExpDate
field) that is between today and a month from today.
Is ExpDate a calculated field?

"Todd" <tak@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:67EAF722-73C3-4764-ABFD-EF0E5FDE9D18@xxxxxxxxxxxxxxxx
Thanks for the info. It did work but my problem is that for each month
separate records are entered on each vehicle. When the query shows the
results it will show expiration dates from the previous years where the
tag
had expired before. Any suggestions on how to only search for the most
recent tag expiration date?
--
Todd


"BruceM" wrote:

Build a query based on the table. Set the criteria in the date field:
Between Date() And DateAdd("m",1,Date())
This will filter for just those records where the expiration date is
between
today and a month from today. See Help for more information about
DateAdd.
You could use the query as the Record Source for a form or report.

"Todd" <tak@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F2599C07-3B4B-4F99-BC63-DB2C98BA1BF6@xxxxxxxxxxxxxxxx
I was mistaken on my explanation previously. The field in table1 is
for
tagexpiration (for when the tag is due renewal), not when the tag
was
purchased.--
Todd








.



Relevant Pages

  • Re: Date criteria
    ... I added ReviewDate to the query as a calculated field: ... It looks right (if the expiration date is 1/15/06, ... Day) or DateAdd as the criteria for ReviewDate ...
    (microsoft.public.access.queries)
  • Re: Date criteria
    ... This is a great program for making global changes in an Access database. ... > A query includes an expiration date that can be several years in the ... every year on the expiration month and day a notice needs to be ... > criteria to retrieve only records with an expiration date between one ...
    (microsoft.public.access.queries)
  • Date criteria
    ... A query includes an expiration date that can be several years in the future. ... The field in question is [EXP DATE]. ... criteria to retrieve only records with an expiration date between one month ...
    (microsoft.public.access.queries)
  • Re: query for tag renewal
    ... I created the query and in the tagexpiration field criteria I inserted the ... The above criteria gave me all tagexpirations in the table. ... ExpDate). ...
    (microsoft.public.access.queries)
  • Re: Date criteria
    ... > A query includes an expiration date that can be several years in the future. ... When I attempted to apply criteria I ... > received a Data type mismatch in criteria expression error message. ...
    (microsoft.public.access.queries)