×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Query Expression Question

Query Expression Question

Query Expression Question

(OP)
In a query I have an expression that calculates a person's age based on today's date and their DOB. Is it possible to create another expression that calculates all these people's ages and gives me an average. Could I do this at the query level or do I have to do it at the report design level? I'm not clear on how do do this at either level.

Thanks for your help.

RE: Query Expression Question

Show your query where you "have an expression that calculates a person's age based on today's date and their DOB" and I am sure somebody will modify it to give you an average age.


---- Andy

There is a great need for a sarcasm font.

RE: Query Expression Question

(OP)
Thanks Andy. Here's the expression: Age: (Now()-[DOB])/365.2425

RE: Query Expression Question

Could you show the entire query?
It is easier to add the Average column to your existing statement, if that's the approach you want to take.

Otherwise, something like:
SELECT ..., Now()-[DOB])/365.2425 As Age,
Avg(
Now()-[DOB])/365.2425) As AvgAge
From ...
GROUP By ...


Where in Group By you mention all fields from your Select statement except AvgAge


---- Andy

There is a great need for a sarcasm font.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close