1 other query expression needing help...

J

jacqueline

The old database's Birth_Date field (date/time datatype) has been changed...
Now 3 separate fields (day, month, year)...all number datatype.

How can I still use this expression with the new fields:

Age_Mar31: Fix((#03/31/2005#-[Birth_Date])/365)
 
L

LeAnne

jacqueline said:
The old database's Birth_Date field (date/time datatype) has been changed...
Now 3 separate fields (day, month, year)...all number datatype.

How can I still use this expression with the new fields:

Age_Mar31: Fix((#03/31/2005#-[Birth_Date])/365)

Hi jacqueline,

Why change? Hard-coding dates and times as strings is not generally
recommended. As you've noticed, it makes comparing dates/times much more
difficult. However, if you're stuck with this design change, try:

Age_Mar31:
Fix((#03/31/2005#-DateSerial([YearField],[MonthField],[DayField])/365)

Be aware that it's not a good idea to name fields "Year," "Month," and
"Day," as these are reserved words in Access that refer to specific
functions.

hth,

LeAnne
 
Top