mreference
Registered User.
- Local time
- Today, 20:28
- Joined
- Oct 4, 2010
- Messages
- 137
I have created a union query which appeared to be working correctly until I checked the actual data. I was expecting 82 records to be returned but am only getting 74.
This is my code
If I run the above code I only get 74 records, all of which are located in the final select statement. When I delete the top two statements (which do not contain any records) the full 82 records appear.
If anyone can shed any light on this, it would be appreciated.
This is my code
Code:
SELECT [Job_Nbr],[projectname],[FinProfileID],[finweek],[finmonthtext],[finyeartext],[Comments],[paid],[datepaid],format([TrueCost],"0.00") AS Charge,"Fixed" AS TypeFee
FROM [qryFixedFeePayments]
UNION SELECT [Job_Nbr],[projectname],[FinProfileID],[finweek],[finmonthtext],[finyeartext],[Comments],[paid],[datepaid],format([TrueCost],"0.00") AS Charge,"Adjustment" AS TypeFee
FROM [qryPaymentAdjuster]
UNION SELECT [Job_Nbr],[projectname],[FinProfileID],[finweek_nbr],[finmonthtext],[finyear_nbr],"No Comments",[paid],[datepaid],format([TrueCost],"0.00") AS Charge,"Timesheet" AS TypeFee
FROM [qryTimesheetandRates]
WHERE [TrueCost] <> 0
ORDER BY [FinProfileID];
If I run the above code I only get 74 records, all of which are located in the final select statement. When I delete the top two statements (which do not contain any records) the full 82 records appear.
If anyone can shed any light on this, it would be appreciated.