I'm completely new to the SQL Server portion of databases. I've created a split Access database that functions well.
As a test I upsized the tables to SQL server. For the most part everything went smoothly; however, two of my queries are no longer working. They are both fairly complex union queries. I believe the union is the culprit to my issues.
With the first one I have two queries using union all. They work individually, but when I use the union query I receive the error "object invalid or no longer set".
With the second one I have 3 queries with union all. These are simpler than the first case. This time I receive the error "The expression is typed incorrectly, or it is too complex to be evaluated."
Is there something specific about union queries with tables on SQL server? Any help or advice is appreciated.
SELECT scrap.coilnum, Sum(scrap.lnff) AS sumoflnff, scrap.code, scrap.location
FROM scrap
WHERE scrap.day>=[Forms]![coilparameters]![Text0] And scrap.day<=[Forms]![coilparameters]![Text2] and scrap.productionline=[Forms]![coilparameters]![combo4] and scrap.coilnum<>0
GROUP BY scrap.coilnum, scrap.code, scrap.location;
union all
SELECT sawscrap.tcoilnum, Sum(sawscrap.length) AS sumoflnff, sawscrap.code, sawscrap.location
FROM sawscrap
WHERE sawscrap.day>=[Forms]![coilparameters]![text0] And sawscrap.day<=[Forms]![coilparameters]![text2] and sawscrap.productionline=[Forms]![coilparameters]![combo4] and sawscrap.tcoilnum is not null and sawscrap.tcoilnum<>0
GROUP BY sawscrap.tcoilnum, sawscrap.code, sawscrap.location;
UNION ALL
SELECT sawscrap.bcoilnum, Sum(sawscrap.length) AS sumoflnff, sawScrap.code, sawscrap.location
FROM sawscrap
WHERE sawscrap.day>=[Forms]![coilparameters]![text0] And sawscrap.day<=[Forms]![coilparameters]![text2] and sawscrap.productionline=[Forms]![coilparameters]![combo4] and sawscrap.bcoilnum is not null and sawscrap.bcoilnum<>0
GROUP BY sawscrap.bcoilnum, sawscrap.code, sawscrap.location;
There is the second one.