473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I have two date fields ,start _period and end_period, i need to get the total

I have two date fields : start_period and end_period, i need to find the total of amount field within a date range
Jul 28 '10 #1
3 1489
MikeTheBike
639 Expert 512MB
Hi

Maybe
Expand|Select|Wrap|Line Numbers
  1. Sum([Amount Field]) FROM TableName WHERE Start_Period <= #StartDate# And end_period >= #EndDate#
This is the stating pont, depending on where the SQL is defined/where the code is run and probable date formating issues, but it is a start!?

StartDate and EndDate could be the same date!

MTB
Jul 29 '10 #2
Thank you so much for your response, BUT,I will really like to create a parameter Query... Given the user the flexibilty to choose the date range. Find below ..

I am presently working on a database using Access 2007. I was able to get the total sum for a particular account from the first date to the last date. But i couldn't get the total sum of between a date range.
Take for example:
Acc_Number Start_Period End_Period Amount
1001 3/12/2010 3/26/2010 500
1001 3/27/2010 4/6/2010 700
1001 4/7/2010 4/21/2010 500

I was able to get the total sum from 3/12/2010 to 3/26/2010 using the aggregate function in access i.e under the Start_Period field , i selected FIRST aggregate function and under End_Period field, i select LAST aggregate function, GROUP BY function for Acc_number and SUM function for Amount in the design sheet view .
BUT AM UNABLE TO GET THE SUM BETWEEN 3/12/2010 - 4/6/2010. USING A PARAMETER QUERY, CAN THIS BE DONE. THANKS..
Jul 29 '10 #3
colintis
255 100+
Can you post the query code that you are working on? otherwise its difficult for us to locate the problem you are having.
Jul 30 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Todd D. Levy | last post by:
Normally, I have a date field in the query that a report is based on that requests the user to select a start date and an end date. I now have a situation where there are 2 date fields that the...
4
by: Stewart Allen | last post by:
I'm trying to filter a table that has 2 date fields, the first date will always have a value but the second will only occasionally has a value. Each date field also has a corresponding text field...
1
by: Riley DeWiley | last post by:
I have an UPDATE query that is always setting 0 records. When I cut and paste the SQL into Access and use it, it fails in the same way unless I coerce the date fields to be '=now()', in which case...
5
by: QBCM | last post by:
I am trying to create a report by selecting three date fields from one table with records between a start date and end date. I have tried to adapt one of Allen Browne's scripts as follows but it...
8
by: Ragbrai | last post by:
Howdy All, I have a query that is used for filtering results to be used in a combo box. The query needs to test fields from both a table and then unbound text boxes on the form that also contains...
2
by: jennwilson | last post by:
I am trying to generate a report based on a query that will list any records where an individual has a date listed that matches the specified time for one or both of the date fields. The two fields...
3
by: dianatokatlidis | last post by:
Hello... I have a big dilemna and I've been struggling for days how to do it I have 2 date fields. StartDate and EndDate. I am trying to get all records where the StartDate is Oct-2007 or...
6
by: Ledmark | last post by:
Hello - I am in a class for Access 2007 Database apllication design and we are covering types of Validation rules. We have a problem that I'm trying to solve but have no idea how to go about writing...
2
by: KMEscherich | last post by:
Microsoft Access 2003 Hi there, am stuck with something that I am not sure on how to get done. I am attempting to have 3 check boxes and have 3 date fields. I need to have each date field be...
2
by: Chellie | last post by:
I am using Access 2007. I have two date fields (date receievd and date complete). I need to be able to run a query and find out who is not completing their work within two days of receipt. I tried...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.