H
hotrod1952 via AccessMonster.com
Newbie!
I have a query setup which achieves the results I want. It is as follows:
SELECT TOP 15 Asset.AssetID, Asset.AssetDescription, Sum(WOLabor.
WOLaborDuration) AS SumOfWOLaborDuration
FROM (WO INNER JOIN Asset ON WO.AssetNo = Asset.AssetNo) INNER JOIN WOLabor
ON WO.WONo = WOLabor.WONo
WHERE (((WOLabor.WOLaborDate)>=[START DATE dd/mm/yy] And (WOLabor.WOLaborDate)
<DateAdd("d",1,[END DATE dd/mm/yy])))
GROUP BY Asset.AssetID, Asset.AssetDescription
ORDER BY Sum(WOLabor.WOLaborDuration) DESC;
I want to add two fields to the query which I would import as text via a
linked excel spreadsheet . However when I do this My query results change. So
I am doing something wrong. I have set up a second query:
SELECT LaborLink.COMMENT, LaborLink.CODE
FROM LaborLink;
And can run it and it works. I tried copying the SQL from both to a third
query and use a union and union all but get an error because the # of columns
is not the same. How to get around this? Or is another complete idea out
there to simplify the entire situation?
I have a query setup which achieves the results I want. It is as follows:
SELECT TOP 15 Asset.AssetID, Asset.AssetDescription, Sum(WOLabor.
WOLaborDuration) AS SumOfWOLaborDuration
FROM (WO INNER JOIN Asset ON WO.AssetNo = Asset.AssetNo) INNER JOIN WOLabor
ON WO.WONo = WOLabor.WONo
WHERE (((WOLabor.WOLaborDate)>=[START DATE dd/mm/yy] And (WOLabor.WOLaborDate)
<DateAdd("d",1,[END DATE dd/mm/yy])))
GROUP BY Asset.AssetID, Asset.AssetDescription
ORDER BY Sum(WOLabor.WOLaborDuration) DESC;
I want to add two fields to the query which I would import as text via a
linked excel spreadsheet . However when I do this My query results change. So
I am doing something wrong. I have set up a second query:
SELECT LaborLink.COMMENT, LaborLink.CODE
FROM LaborLink;
And can run it and it works. I tried copying the SQL from both to a third
query and use a union and union all but get an error because the # of columns
is not the same. How to get around this? Or is another complete idea out
there to simplify the entire situation?