Hey all,
Here's my newest problem...
I have a query (qryP1Pound) pulling data from two tables: FailureHub and SalvageHub. I want the query to count entries in two timelines (2005/2004) in both tables, then subtract the two counts to give me total un-salvageable failures in each year.
After adding the date in so I could see individual entries, I discovered that the problem is whenever there are salvaged items - the failure items shows up as the same number (it shouldn't be) and when I subtract them it appears as zero.
Any suggestions? Here's my SQL:
I'd really appreciate any help.
Here's my newest problem...
I have a query (qryP1Pound) pulling data from two tables: FailureHub and SalvageHub. I want the query to count entries in two timelines (2005/2004) in both tables, then subtract the two counts to give me total un-salvageable failures in each year.
After adding the date in so I could see individual entries, I discovered that the problem is whenever there are salvaged items - the failure items shows up as the same number (it shouldn't be) and when I subtract them it appears as zero.
Any suggestions? Here's my SQL:
Code:
SELECT Count(FailureHub.IDfailure) AS fai, Format([failurehub].[Date],"yyyy") AS [Year], Count(SalvageHub.IDsalvage) AS sal, [fai]-[sal] AS Expr1
FROM FailureHub LEFT JOIN SalvageHub ON FailureHub.Date = SalvageHub.Date
WHERE (((FailureHub.Date)>=#5/19/2005# And (FailureHub.Date)<=#5/23/2005#)) OR (((FailureHub.Date)>=#5/19/2004# And (FailureHub.Date)<=#5/23/2004#))
GROUP BY Format([failurehub].[Date],"yyyy");
I'd really appreciate any help.