1 other query expression needing help...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top