473,473 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

calculating totals in a query

Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 ?
2/1/2004 $4,484,710.00 ?
3/1/2004 $4,537,424.00 ?
4/1/2004 $4,826,850.00 ?
5/1/2004 $4,966,326.00 ?

Can someone help? What I am trying to do is create a query that will
end up looking like the bottom example. The above query is a
calculated totals query with an aggregate sum function. What it is
doing is summing up all the Budget_NOIs for the month of January and
outputting it as shown (I got that done). And it will do that for
every month as time progresses. What I need help doing is calculating
the portion with the question marks. What I need it to do (below
there is an example on how I want it to look) is sum up all the
SumOfBudget_NOIs from January to the current month. For example, the
February amount would be the sum of both January's and February's
SumOfBudget_NOI. For March, it will be the sum January's, February's
and March's SumOfBudget_NOI. For April, it will be the sum January's,
February's, March's and April's SumofBudget_NOI. And so on for the
other months to come. I really have no idea how to approach this
problem. Any suggestions.
THANKS!

Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 $4,184,626.00
2/1/2004 $4,484,710.00 $8,669,336.00
3/1/2004 $4,537,424.00 $13,206,760.00
4/1/2004 $4,826,850.00 $18,033,610.00
5/1/2004 $4,966,326.00 $22,999,936.00
Nov 13 '05 #1
3 1636
In the vb window (hit altF11) look up dateserial and associated
functions.

here's an example by grouped by date not month but you will get the
idea.

select pd, sum(b) as monthb,
first(
(select sum(pd) from tbl where month(pd) between 1 and month(pd)+1)
) as ytd
from tbl
group by pd;

Paul Mendez <pm*****@thelyndco.com> posted in
news:99**************************@posting.google.c om
Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 ?
2/1/2004 $4,484,710.00 ?
3/1/2004 $4,537,424.00 ?
4/1/2004 $4,826,850.00 ?
5/1/2004 $4,966,326.00 ?

Can someone help? What I am trying to do is create a query that will
end up looking like the bottom example. The above query is a
calculated totals query with an aggregate sum function. What it is
doing is summing up all the Budget_NOIs for the month of January and
outputting it as shown (I got that done). And it will do that for
every month as time progresses. What I need help doing is calculating
the portion with the question marks. What I need it to do (below
there is an example on how I want it to look) is sum up all the
SumOfBudget_NOIs from January to the current month. For example, the
February amount would be the sum of both January's and February's
SumOfBudget_NOI. For March, it will be the sum January's, February's
and March's SumOfBudget_NOI. For April, it will be the sum January's,
February's, March's and April's SumofBudget_NOI. And so on for the
other months to come. I really have no idea how to approach this
problem. Any suggestions.
THANKS!

Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 $4,184,626.00
2/1/2004 $4,484,710.00 $8,669,336.00
3/1/2004 $4,537,424.00 $13,206,760.00
4/1/2004 $4,826,850.00 $18,033,610.00
5/1/2004 $4,966,326.00 $22,999,936.00


--
Phil
Nov 13 '05 #2
that seems a little too complex for me, what and where did you want me
to put that. i thought i knew enough to understand, but i was so
wrong. Thanks Phil!
"Phil" <st***@basketball.net> wrote in message news:<AF*******************@newssvr24.news.prodigy .com>...
In the vb window (hit altF11) look up dateserial and associated
functions.

here's an example by grouped by date not month but you will get the
idea.

select pd, sum(b) as monthb,
first(
(select sum(pd) from tbl where month(pd) between 1 and month(pd)+1)
) as ytd
from tbl
group by pd;

Paul Mendez <pm*****@thelyndco.com> posted in
news:99**************************@posting.google.c om
Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 ?
2/1/2004 $4,484,710.00 ?
3/1/2004 $4,537,424.00 ?
4/1/2004 $4,826,850.00 ?
5/1/2004 $4,966,326.00 ?

Can someone help? What I am trying to do is create a query that will
end up looking like the bottom example. The above query is a
calculated totals query with an aggregate sum function. What it is
doing is summing up all the Budget_NOIs for the month of January and
outputting it as shown (I got that done). And it will do that for
every month as time progresses. What I need help doing is calculating
the portion with the question marks. What I need it to do (below
there is an example on how I want it to look) is sum up all the
SumOfBudget_NOIs from January to the current month. For example, the
February amount would be the sum of both January's and February's
SumOfBudget_NOI. For March, it will be the sum January's, February's
and March's SumOfBudget_NOI. For April, it will be the sum January's,
February's, March's and April's SumofBudget_NOI. And so on for the
other months to come. I really have no idea how to approach this
problem. Any suggestions.
THANKS!

Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 $4,184,626.00
2/1/2004 $4,484,710.00 $8,669,336.00
3/1/2004 $4,537,424.00 $13,206,760.00
4/1/2004 $4,826,850.00 $18,033,610.00
5/1/2004 $4,966,326.00 $22,999,936.00

Nov 13 '05 #3
in the query design use the sql view and copy and paste this sql. But
you have to give it your own field and table names, these are just for
example.

in the vba you can open up help and search for month and other date
functions. they allow you to manipulate dates in sql.

this example just shows how to use a subquery for getting the running
total.

post exact field names and I can make it for you. Then when you hit the
visual design window for queries you can see how it is done there.
Paul Mendez <pm*****@thelyndco.com> posted in
news:99*************************@posting.google.co m
that seems a little too complex for me, what and where did you want me
to put that. i thought i knew enough to understand, but i was so
wrong. Thanks Phil!
"Phil" <st***@basketball.net> wrote in message
news:<AF*******************@newssvr24.news.prodigy .com>...
In the vb window (hit altF11) look up dateserial and associated
functions.

here's an example by grouped by date not month but you will get the
idea.

select pd, sum(b) as monthb,
first(
(select sum(pd) from tbl where month(pd) between 1 and
month(pd)+1) ) as ytd
from tbl
group by pd;

Paul Mendez <pm*****@thelyndco.com> posted in
news:99**************************@posting.google.c om
Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 ?
2/1/2004 $4,484,710.00 ?
3/1/2004 $4,537,424.00 ?
4/1/2004 $4,826,850.00 ?
5/1/2004 $4,966,326.00 ?

Can someone help? What I am trying to do is create a query that
will end up looking like the bottom example. The above query is a
calculated totals query with an aggregate sum function. What it is
doing is summing up all the Budget_NOIs for the month of January and
outputting it as shown (I got that done). And it will do that for
every month as time progresses. What I need help doing is
calculating the portion with the question marks. What I need it to
do (below there is an example on how I want it to look) is sum up
all the SumOfBudget_NOIs from January to the current month. For
example, the February amount would be the sum of both January's and
February's SumOfBudget_NOI. For March, it will be the sum
January's, February's and March's SumOfBudget_NOI. For April, it
will be the sum January's, February's, March's and April's
SumofBudget_NOI. And so on for the other months to come. I really
have no idea how to approach this problem. Any suggestions.
THANKS!

Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total
1/1/2004 $4,184,626.00 $4,184,626.00
2/1/2004 $4,484,710.00 $8,669,336.00
3/1/2004 $4,537,424.00 $13,206,760.00
4/1/2004 $4,826,850.00 $18,033,610.00
5/1/2004 $4,966,326.00 $22,999,936.00


--
Phil
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: | last post by:
I have an Access database used to track donor pledges. In it, there is a table that contains three fields for each donor: Gift_Amount, Gift_Per_Year, and Matching_Gift_Ratio. The following...
4
by: The Bit Bandit | last post by:
Hopefully someone can help me create a query that I'm having some trouble with. I have three tables: invoices, invoicedetails, invoicepayments The fields are: invoices -------- InvoiceNo
2
by: mhodkin | last post by:
I created a query in which I have grouped data by City. I wish to calculate the percent of each value, e.g. City/(Total count of all Cities), in tbe next column of the query. I can't seem to...
4
by: New Guy | last post by:
I'm trying to work with a system that somebody else built and I am confounded by the following problem: There is a table of payments and a table of charges. Each client has charges and payments...
2
by: BerkshireGuy | last post by:
I have the following code: Dim strSQL As String Dim DB As DAO.Database Dim RS As DAO.Recordset Dim intNumOfPaid, intNumOfHypoed, intNumOfNotTaken, intNumOfDeclined, intNumOfWasted,...
2
by: Tim Marshall | last post by:
Wondering if anyone has any suggestions for this. Sometimes in the form reports my users run, a data sheet subform on a main form, with totals in text boxes with calculated controlsources...
5
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new...
38
by: d0ugg | last post by:
I'm writing a program that will have to roll the dice A and dice B one million times, and calculate the percentage of times that the dies will be equal. I'm having trouble to figure out how the...
25
by: Blaize | last post by:
Hi, I'm having an issue trying to calculate time. Its okay if the value does not exceed 24 hours otherwise I get a date and hours listed. For example, I have a loop which looks through a table...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.