How can I search birthdates, time values,
for example i want to find the people born between 1980 and 1989
the data birthdate is written in this format 4/25/1990 or 25/4/1990
how can I search this time in query 3:00:00 pm , what should i write in the
criteria field
How the date is written is (almost) irrelevant. If you're storing it
in a Date/Time field, it's stored as a number - a double float count
of days and fractions of a day.
To find people born in the 80's, you can use a criterion on the
birthdate field
BETWEEN #1/1/1980# AND #12/31/1989#
The # character indicates to Access that the criterion is a date
(rather than, say, a continued fraction). For a parameter query, use a
criterion like
BETWEEN [Enter start date:] AND [Enter end date:]
Right mouseclick in the query background behind the tables, select
Parmeters, and copy and paste the bracketed expressions into the left
column; specify that they are of Date type.
For times, some caution is necessary. The double float number contains
both a date and a time portion, so #3/15/2005 03:00pm# is NOT the same
value as #3/14/2004 03:00pm#; in addition, the float number is precise
to a few microseconds, but you can only display and search to the
nearest second. TRY using a criterion on a pure Time field of
#03:00:00pm#
but be aware of the limitations!
John W. Vinson[MVP]