fat controller
Slightly round the bend..
- Local time
- Today, 18:01
- Joined
- Apr 14, 2011
- Messages
- 758
I have two queries, separately they work fine, but I would like to join them somehow for a report - yet they have no shared fields.
The SQL for the first:
And the SQL for the second:
I have broken the second one up a bit lest I inflict blindness on anyone :biggrin:
Essentially, I am wanting the data from the second query in the page header of a report, and the rest is in the detail of the report.
I have tried opening the query for the report and pulling both queries in, however that throws up an error when I try and run the query "Query input must contain at least one table or query"
Is there a way to bring peace and harmony?
The SQL for the first:
Code:
SELECT UnfitVehicles.ID, UnfitVehicles.[Bonnet Number], UnfitVehicles.DateUnfit, UnfitVehicles.ReasonUnfit, UnfitVehicles.ExpectedReturnDate, UnfitVehicles.VehicleType, UnfitVehicles.ActualReturnDate, UnfitVehicles.CurrentStatus, UnfitVehicles.StatusReason, UnfitVehicles.VehicleType, UnfitVehicles.MadeUnfitBy, UnfitVehicles.DeclaredFitBy, UnfitVehicles.PartsAwaited
FROM UnfitVehicles
WHERE (((UnfitVehicles.ActualReturnDate) Is Null));
And the SQL for the second:
Code:
SELECT DCount("TypeRequired","AllocatedVehiclesToday","TypeRequired='" & "Double Deck" & "'") AS Expr1,
DCount("TypeRequired","AllocatedVehiclesToday","TypeRequired='" & "Single Deck" & "'") AS Expr2,
DCount("TypeRequired","AllocatedVehiclesToday","TypeRequired") AS Expr3,
DCount("VehicleType","AllocatedVehiclesToday","VehicleType='" & "Double Deck" & "'") AS Expr4,
DCount("VehicleType","AllocatedVehiclesToday","VehicleType='" & "Single Deck" & "'") AS Expr5,
DCount("VehicleType","AllocatedVehiclesToday","VehicleType") AS Expr6,
DCount("VehicleType","CallOverUnfits","VehicleType='" & "Double Deck" & "'") AS Expr7, DCount("VehicleType","CallOverUnfits","VehicleType='" & "Single Deck" & "'") AS Expr8,
DCount("VehicleType","Live_Vehicles","VehicleType='" & "Double Deck" & "'") AS Expr9,
DCount("VehicleType","Live_Vehicles","VehicleType='" & "Single Deck" & "'") AS Expr10;
I have broken the second one up a bit lest I inflict blindness on anyone :biggrin:
Essentially, I am wanting the data from the second query in the page header of a report, and the rest is in the detail of the report.
I have tried opening the query for the report and pulling both queries in, however that throws up an error when I try and run the query "Query input must contain at least one table or query"
Is there a way to bring peace and harmony?