Compute Age

Mar 2, 2007

Hi all,
my question is how do I compute an age based on the day of birth, and compute the average age, all in the same query ?

All answers would be appreciated.

View Replies


ADVERTISEMENT

Queries :: SQL Code To Compute Moving Average

Dec 3, 2013

I have a query that pulls data from a table called Data. I'd like to add a column to the query that will be the moving average -- For example, for a Month Beginning Date of 12/2013, it would average the SumOfCount variable for 10/2013, 11/2013, and 12/2013.

This is the sql code for my query without the moving average:

SELECT Data.Behavior, Sum(Data.Count) AS SumOfCount, Data.[Month Beginning Date], [First Name + Last Name].Wing, Data.[Full Name]
FROM Data INNER JOIN [First Name + Last Name] ON Data.[Full Name] = [First Name + Last Name].[Full Name]
GROUP BY Data.Behavior, Data.[Month Beginning Date], [First Name + Last Name].Wing, Data.[Full Name]
HAVING (((Data.Behavior)="PRNs") AND ((Data.[Full Name])=[forms]![report parameters]![fullname]));

How to insert that column into my code?

View 14 Replies View Related

Queries :: Compute Field With DLookUp In Query?

Jun 6, 2014

I'm designing a query. It's very simple.

I just need to compute something like:

Var: TT[YYZ for this month]-TT[YYZ for last month]

The table is called C1 and has the fields i'm interested

YYZ: Location
TT: number
mxx: date

So, i have for YYZ a list of places and for TT a list of values. MXX has the date of the record on the table.

There is one record per date, which it means, there only one record for 1/1/1991 for the YYZ=2.

NF should calculate the difference between the the record on t against t-1.

I've tried with this

Var: YYZ-DLookUp("yyz","[C1]"," "[YYZ]=[YYZ]" AND "[mxx]=DateAdd("m", "-1", "[mxx]"))

But it fails.

I upload a xls sheet with the desired field, Var ,calculated.

View 2 Replies View Related

Queries :: Compute Year Growth For A Field

Jun 2, 2014

I need to compute the increase for the field Area the following:

yyz(t)-yyz(t-12).

T es month. The table has this structure

Area yyz date Y

Area represents different locations. Each area has only one record per month. Month is obviously the field Date. And Y is yyz(t)-yyz(t-12).

I tried to use DateAdd on access 2013 but the function seems strange, and besides, i don't know how to link
Area yyz(t) date Y:yyz(t)-yyz(t-12).

I just want to create a query in which i can see for each record his yyz value this month and yyz the last year on Y.

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved