473,651 Members | 2,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with queries (Last payment date and payment amount)

Hi all,

I am a novice to Access, and was wondering if I could get some help on
a problem I can't solve.

I have a database with customer payments, structured like this:
customer code
type of payment
date of payment
payment amount

For each customer, filtering for one specific type of payment only, I
need to know what the last payment date was, and how much he paid on
that date. If there was more than one payment on that same day, I need
the sum.

I managed to build a query which yields the last payment date, and one
which sums payments by date, but how do I combine the two?

Thanks a lot for your help, and sorry if the question is too banal!

Sep 12 '07 #1
1 2696
On Wed, 12 Sep 2007 04:06:18 -0700, "my********@goo glemail.com"
<my********@goo glemail.comwrot e:

This is a good question. I solve it by creating two queries. The first
one finds the last date, then I inner join that query with the table
itself, typically joining on several fields (e.g. customercode,
paymentdate) to pick up the other fields (e.g. paymentamount) in the
row.

-Tom.

>Hi all,

I am a novice to Access, and was wondering if I could get some help on
a problem I can't solve.

I have a database with customer payments, structured like this:
customer code
type of payment
date of payment
payment amount

For each customer, filtering for one specific type of payment only, I
need to know what the last payment date was, and how much he paid on
that date. If there was more than one payment on that same day, I need
the sum.

I managed to build a query which yields the last payment date, and one
which sums payments by date, but how do I combine the two?

Thanks a lot for your help, and sorry if the question is too banal!
Sep 12 '07 #2

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

Similar topics

3
2002
by: MAB | last post by:
I have a table Create Table Payments { paymentid int, customerid int, amount int, date datetime } What I want is the sum of the amounts of the last payments of all customers.
18
12797
by: Jeremy Weiss | last post by:
I'm trying to build a database that will handle the monthly billing needs of a small company. I'm charting everything out and here's what I see: table for customers sub table to track payments received. No biggie, right? Well, here's my problem. I don't know how to tell access to modify everyone's account balance each month. And I can't just always assume that their monthly bill is $16 just because their balance is $16. If I do that...
9
4344
by: Dom Boyce | last post by:
Hi First up, I am using MS Access 2002. I have a database which records analyst rating changes for a list of companies on a daily basis. Unfortunately, the database has been set up (by my predecessor, I hasten to add) so that each day it creates a copy of the record for each company, changes the date to today's date, and prompts the user for any changes of ratings on that day. The resulting data table grows by approx 600 records per...
4
1482
by: Ron | last post by:
Hi All I've got 2 files, transactions and comments, linked by a clientID as a FK in the clients file and as a FK in the comments file (PK in the 'client' file of course). The comments don't necessarily have to have anything to do with the transactions, but usually they do (explanations about when payment will be sent, who in the office has talked to the client about the bill and what was said, etc). The comments, rather than being a...
0
921
by: paapa21 | last post by:
I have got a page that shows student payment information. On the page the user can view total amount paid by student, amount outstanding and the course fee; add paymnent to the database; and also view individual payment made with their corresponding date of paymnent, the method of payment and the amount paid. These are all under three respectivel panel in one page. What i really want to do is, If a user add payment to the database, i want...
4
1815
by: J | last post by:
I am editing a pre-existing view. This view is already bringing data from 40+ tables so I am to modify it without screwing with anything else that is already in there. I need to (left) join it with a new table that lists deposits and the dates they are due. What I need is to print, for each record in the view, the due date for the next deposit due and the total of all payments that they will have made by the next due date.
4
2112
by: kjflash | last post by:
Hi, Let's say I have a table containing payment information: CustID, PaymentDate, PaymentAmount. Here is some sample data: CustID Date Amount 01 01/01/07 50.00 01 02/01/07 100.00
4
1958
by: ringer | last post by:
I need help with a crosstab query. I would like the column headings to be the last 6 months, the row headings to be billers, and the data in the middle to be both the date that a payment was made (falling within the month headings) and also the amount paid in that payment. Sometimes there might be more than one payment to a biller in a month or there might be no payments to that biller in a month. All of the raw data needed is in one table. I...
4
1755
by: tfhanson | last post by:
Hi, been a real long time since I have worked in ASP and XML and a neighbor asked me to help him with a web page. I have an XML file that I am trying to search thru and display the children nodes...... Here is a sample of the xml <document> <MEMBER> <ID>000-00-0010</ID> <CHARGES> <CHARGE><ChargeDate>06/25/2007</ChargeDate> <Code>BANQ</Code><Desc>BANQUET</Desc> <Amount>0.00</Amount><Note></Note></CHARGE>...
0
8275
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8802
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8697
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7297
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.