Connecting Tech Pros Worldwide Forums | Help | Site Map

consolidated information in query

Newbie
 
Join Date: Sep 2006
Posts: 17
#1: Jul 11 '07
I have four tables as follows

Table -1 – "expenditure"
Field 1- date of payment
Field 2 – type of payment
Field 3 – Amount paid

Table – 2 "Medicine purchase"
Field 1- date of purchase
Field 2 – Name of medicine
Field 3 – Qty purchased
Field 4 – Amount paid


Table -3 "Patient"
Field- 1- Patient registration No
Field -2 – Patient admission date
Field -3 – Referred by
Field -4 – surgeon attended
Field- 5 – Fees received


Table -4 "Surgeon charges"
Field 1 – Surgeon name
Field 2- Patient registration No
Field 3 – date of visit
Field 4 – Fees paid
Field -5 – Date of payment

Table -5 "Referral commission"
Field- 1- Patient registration No
Field-2- referred by
Field -3 – Referral commission paid
Field-4- date of payment

Now I want to design a query – "cash book" in which I want to consolidate the cash outflows of all the 4 tables date wise as follows
Field – 1 – date
Field –2- Amount received
Field – 3-amount paid


Please tell me how I should do it.

Scott Price's Avatar
Moderator
 
Join Date: Jul 2007
Location: Seattle, WA
Posts: 1,314
#2: Aug 25 '07

re: consolidated information in query


A general overview of what you need to do is create a SELECT query that groups by date, and sums the other two fields.

Are you wanting to add each cash in transaction to this query from each table, as well as the same with each cash out transaction?

Regards,
Scott
Reply