473,385 Members | 1,154 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,385 software developers and data experts.

Multiple Date Query

Access 2007 - I have a table containing 6 dates (date, date1, date2, etc. There are payments associated with these dates (payment1, payment 2, ect). I want to write a query that will total all payments for a specific date range by entering a [Start Date] And [End Date] once to cover all six dates and payments. I wrote a query using payment1, payment2, .....sum and date [start date] and [end date]. It doesn't return all the payments (but it does return some)in the table for date1, date2,etc. Should I include all the date fields? Will the user be required to enter start date and end date for all six? Must be an easier way.
Feb 23 '11 #1
2 1617
orangeCat
83 64KB
Show us the query that you tried.
Your reference to fields such as payment1, payment2... and date1, date2... suggest non normalized data (table structure issues)
Feb 24 '11 #2
Here's the query
SELECT [RPC Hazards Payments].[Contract Number], Sum([RPC Hazards Payments].Payment1) AS SumOfPayment1, Sum([RPC Hazards Payments].Payment2) AS SumOfPayment2, Sum([RPC Hazards Payments].Payment3) AS SumOfPayment3, Sum([RPC Hazards Payments].Payment4) AS SumOfPayment4, Sum([RPC Hazards Payments].Payment5) AS SumOfPayment5, Sum([RPC Hazards Payments].Payment6) AS SumOfPayment6
FROM [RPC Hazards Payments]
WHERE ((([RPC Hazards Payments].Date) Between [Enter Start Date] And [Enter End Date]))
GROUP BY [RPC Hazards Payments].[Contract Number];

These tables were originally imported from excel and I didn't want to have to rebuild the database - I'm certainly open to suggestions - still learning -thanks
Feb 24 '11 #3

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

Similar topics

4
by: Gleep | last post by:
Hey Guys, I've got a table called Outcomes. With 3 columns and 15 rows 1st col 2nd col 3rdcol outcome date price There are 15 rows...
9
by: Gleep | last post by:
sorry i didn't explain it correctly before my table is like this example fields: ID name username outcome date1 date2 date3 (etc..) - date15 price1 price2 price3 (etc..) I know that...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
3
by: Jim | last post by:
I'm having a problem with a date query..im trying to pull customer data based on a date specified from a form to 3 months prior to the date specified. So lets say in the form I specified 1/2/2004....
2
by: junkaccount | last post by:
Hello, Using Access 2000 I would like to create one report that returns sales data for various date ranges input by the user i.e. weekly, monthly, etc. This report is bound to a query that pulls...
3
by: Beejer | last post by:
I'm currently having a hard time getting my expression to run in my billing query. My setup: MS Access 2003 Qry Billing (includes 6 tables such as Client, Price list, Formula, Order, Order...
0
by: djflow | last post by:
Hi! II was wondering if you can help me with SQL query.. Below 7 separated select query works fine(only when they are retrieved separately) But I want to combined them together and so that i...
2
by: josecruz | last post by:
I hope this make sense... When students leave school (dropout, medical reasons, etc), there is a date field that admission use to record this event. For program evaluation, I want to know what...
16
by: Alex30093 | last post by:
OK This is my 1st post to any forum, but I rely on forums all the time. Short story is I find myself needing to become a Access DBA for work. Situation: I want to use one table of events that...
21
by: katlee | last post by:
I am using Access 2007 to design a database that will allow users to search an inventory of historical photographs. Currently I have a table with fields such as Date, ID, Description, Project,...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.