General discussion

Locked

Query Expression in Access problem

By bjjhome.bt ·
Hi all

Im tearing my hair out here!!! I am trying to work out an age from a date of birth and using the Now() function in Access.

The problem is that any date of birth over 1972 -i.e. 16/09/1973 - shows as 4 figures even though I have formatted the field to yy and zero decimal places. The formula I have used for the expression is, AGE: Now()-[dob]

Has anyone any ideas

Thanks
Brian

This conversation is currently closed to new comments.

4 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Query Expression in Access problem

by DKlippert In reply to Query Expression in Acces ...

See if Dev Ashish's instructions help. You may have to split up the answer into years, months etc.

http://tinyurl.com/grbe

Collapse -

Query Expression in Access problem

by techrep In reply to Query Expression in Acces ...

This code works fine for me:

Dim Age, BirthDate
BirthDate = #9/16/73#
Age = Now - BirthDate
Age = Format(Age, "yy")
Debug.Print "Age = " & Age 'Age=29

Collapse -

Query Expression in Access problem

Have you tried the DateDiff function?

Collapse -

by bjjhome.bt In reply to Query Expression in Acces ...

This question was closed by the author

Back to Web Development Forum
4 total posts (Page 1 of 1)  

Related Discussions

Related Forums