WB786
MIS
- Mar 14, 2002
- 610
I am new to SQL queries and need to build one that involves 3 tables. tblClients, tblPayments, tblReceipts. tblPayments and tblReceipts have the foreign key ClientID.
This is what I have so far, which ofcourse doesn't work:
SELECT Clients.SSN, Clients.LastName, Clients.FirstName, Payments.Type, Payments.Amount, Payments.Created
FROM CLIENTS INNER JOIN Payments ON Clients.ClientID = Payments.ClientID
WHERE Payments.Created between '2001-08-08' and '2001-12-31' and Payments.Type in(1,2,4)
UNION
SELECT Receipts.ReceiptAmount, Receipts.DateReceived
FROM Receipts
I am getting an error that says to convert money to nvarchar.
I read a little bit about UNION queries but can't seem to figure it out.
Thanks in advance,
WB
This is what I have so far, which ofcourse doesn't work:
SELECT Clients.SSN, Clients.LastName, Clients.FirstName, Payments.Type, Payments.Amount, Payments.Created
FROM CLIENTS INNER JOIN Payments ON Clients.ClientID = Payments.ClientID
WHERE Payments.Created between '2001-08-08' and '2001-12-31' and Payments.Type in(1,2,4)
UNION
SELECT Receipts.ReceiptAmount, Receipts.DateReceived
FROM Receipts
I am getting an error that says to convert money to nvarchar.
I read a little bit about UNION queries but can't seem to figure it out.
Thanks in advance,