finding a previous date

  • Thread starter Thread starter Amy
  • Start date Start date
A

Amy

I am trying to find data to see if a client needs to bring
their pet back to us for an assessment. Need to create a
query??? I have the clients date of birth (the pet is the
client), but need to find say, what pets were born between
6 & 7 months ago and should come to us for a 6 month
assessment. I have tried a between statement, but always
end up changing the dates (very labour intensive for the
future). Is there some way to specify that I need to have
the current date-6 months. I cannot seem to have the
comouter recognize it as 6 months. How on earth do I go
about doing this?? I am assuming I need to build an
expression inside the criteria in a query to sort
everything out, but cannot seem to hit the right one. DOes
anyone have any monumental ideas!!!??? Thanks
 
Try the Query with the SQL String like:

SELECT C.*
FROM tblClient AS C
WHERE C.DOB BETWEEN DateAdd("m", -7, Date())
AND DateAdd("m", -6, Date())
 
Amy,
I have two suggestions for you:
Develop a query that has the information you want in it,
including the client DOB. In the criteria of the DOB
field write the statement Between Date()-210 And Date()-
180. Date() is the current date of your system clock.
As far as I know, you can only subtract days, somebody
else may be able to tell us how to subtract exact
months. You might also try developing a parameter
query. Use the same query but in the criteria of the DOB
field put: Between [Enter beginning date] And [Enter the
ending date]. Now when you run the query, a little box
will pop up for the user to enter.
If the date() criteria by chance does not work, write
back.
 
Back
Top