Running Total in My Query

G

Guest

Can someone give a hand with adding a running total to my query, as I had a
bit of difficulty with it? As you can see 'FTE' is a caclulated field. What I
would like to do is have a running total right next to that column. Thank you

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE INFO].[WK GP], [EMPLOYEE
INFO].[PB START], [SchedHrs]/40 AS FTE
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];
 
J

John Spencer

A running total of what? and based on what?

A running total of SchedHrs by PB Start?

Perhaps you could post a three or four record sample of what you expect to
see.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Sorry for being Vaugue. A running total of the FTE column which calculates
the SchedHrs divided by a 40 hour work week. John Doe, may be 1.0 while Jane
Doe is .75 so the total for the two would be 1.75. Does that help clarify?
Thank you

John Spencer said:
A running total of what? and based on what?

A running total of SchedHrs by PB Start?

Perhaps you could post a three or four record sample of what you expect to
see.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Dingo said:
Can someone give a hand with adding a running total to my query, as I had
a
bit of difficulty with it? As you can see 'FTE' is a caclulated field.
What I
would like to do is have a running total right next to that column. Thank
you

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE INFO].[WK GP], [EMPLOYEE
INFO].[PB START], [SchedHrs]/40 AS FTE
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];
 
J

John Spencer

1.75 is a total. A running total is one that changes as a date time changes
or as some other factor changes.

So guessing that you want a running total based on the field PB Start, you
could add that to your query as follows.

SELECT [EMPLOYEE INFO].[Employee Name]
, [EMPLOYEE INFO].[WK GP]
, [EMPLOYEE INFO].[PB START]
, [SchedHrs]/40 AS FTE
, (SELECT Sum(SchedHrs)/40
FROM [Employee Info] as E
WHERE E.[PB Start] <= [Employee Info].[PB Start]
AND E..[WK GP] = "svtra") as RunningTotal
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Dingo said:
Sorry for being Vaugue. A running total of the FTE column which calculates
the SchedHrs divided by a 40 hour work week. John Doe, may be 1.0 while
Jane
Doe is .75 so the total for the two would be 1.75. Does that help clarify?
Thank you

John Spencer said:
A running total of what? and based on what?

A running total of SchedHrs by PB Start?

Perhaps you could post a three or four record sample of what you expect
to
see.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Dingo said:
Can someone give a hand with adding a running total to my query, as I
had
a
bit of difficulty with it? As you can see 'FTE' is a caclulated field.
What I
would like to do is have a running total right next to that column.
Thank
you

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE INFO].[WK GP],
[EMPLOYEE
INFO].[PB START], [SchedHrs]/40 AS FTE
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];
 
G

Guest

FTE is the field requiring a running total. Nothing else matters. Thank you

John Spencer said:
1.75 is a total. A running total is one that changes as a date time changes
or as some other factor changes.

So guessing that you want a running total based on the field PB Start, you
could add that to your query as follows.

SELECT [EMPLOYEE INFO].[Employee Name]
, [EMPLOYEE INFO].[WK GP]
, [EMPLOYEE INFO].[PB START]
, [SchedHrs]/40 AS FTE
, (SELECT Sum(SchedHrs)/40
FROM [Employee Info] as E
WHERE E.[PB Start] <= [Employee Info].[PB Start]
AND E..[WK GP] = "svtra") as RunningTotal
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Dingo said:
Sorry for being Vaugue. A running total of the FTE column which calculates
the SchedHrs divided by a 40 hour work week. John Doe, may be 1.0 while
Jane
Doe is .75 so the total for the two would be 1.75. Does that help clarify?
Thank you

John Spencer said:
A running total of what? and based on what?

A running total of SchedHrs by PB Start?

Perhaps you could post a three or four record sample of what you expect
to
see.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Can someone give a hand with adding a running total to my query, as I
had
a
bit of difficulty with it? As you can see 'FTE' is a caclulated field.
What I
would like to do is have a running total right next to that column.
Thank
you

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE INFO].[WK GP],
[EMPLOYEE
INFO].[PB START], [SchedHrs]/40 AS FTE
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];
 
J

John Spencer

Ok, I guess you know what you want.

Enjoy life.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Dingo said:
FTE is the field requiring a running total. Nothing else matters. Thank
you

John Spencer said:
1.75 is a total. A running total is one that changes as a date time
changes
or as some other factor changes.

So guessing that you want a running total based on the field PB Start,
you
could add that to your query as follows.

SELECT [EMPLOYEE INFO].[Employee Name]
, [EMPLOYEE INFO].[WK GP]
, [EMPLOYEE INFO].[PB START]
, [SchedHrs]/40 AS FTE
, (SELECT Sum(SchedHrs)/40
FROM [Employee Info] as E
WHERE E.[PB Start] <= [Employee Info].[PB Start]
AND E..[WK GP] = "svtra") as RunningTotal
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee Name];

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Dingo said:
Sorry for being Vaugue. A running total of the FTE column which
calculates
the SchedHrs divided by a 40 hour work week. John Doe, may be 1.0 while
Jane
Doe is .75 so the total for the two would be 1.75. Does that help
clarify?
Thank you

:

A running total of what? and based on what?

A running total of SchedHrs by PB Start?

Perhaps you could post a three or four record sample of what you
expect
to
see.

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Can someone give a hand with adding a running total to my query, as
I
had
a
bit of difficulty with it? As you can see 'FTE' is a caclulated
field.
What I
would like to do is have a running total right next to that column.
Thank
you

SELECT [EMPLOYEE INFO].[Employee Name], [EMPLOYEE INFO].[WK GP],
[EMPLOYEE
INFO].[PB START], [SchedHrs]/40 AS FTE
FROM [EMPLOYEE INFO]
WHERE ((([EMPLOYEE INFO].[WK GP])="svtra"))
ORDER BY [EMPLOYEE INFO].[PB START], [EMPLOYEE INFO].[Employee
Name];
 

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

Top