Hi all,
I'm in the middle of a form. Currently, I'm constructing a combo box based on a query that autofills several text boxes. I'm having an issue with one part of the query in the combo box.
(((DateDiff("n", [StartTime], [EndTime])) / 60) - ([SetUpTime]+[CleanUpTime]+[MaintUnschedDT]+[TestUnschedDT]+[OtherUnschedDT]+[MixUnschedDT]+[RTODT])
In my table, I have a main start and end time for a process. These are in 00:00:00 format. I also have many fields (setuptime, cleanuptime, etc) that represent downtime that are in hour format (so 1.5 is 1 hour 30 mins). In this part of the query, I am trying to calculate the total actual work time: the amount of time between StartTIme and EndTime, minus the downtime fields.
However, I get an error message saying "Syntax error (missing operator)", but I can't find out where.
Here is the total query I put in the Row Source field of the combo box:
SELECT Productivity.Product, Productivity.LotNumber, Productivity.YardsOn, Productivity.YardsOff, (FormatPercent([YardsOff]/[YardsOn])), (((DateDiff("n", [StartTime], [EndTime])) / 60) - ([SetUpTime]+[CleanUpTime]+[MaintUnschedDT]+[TestUnschedDT]+[OtherUnschedDT]+[MixUnschedDT]+[RTODT]) FROM Productivity WHERE (((Productivity.ProdDate)=Forms!Form1!CategoryID))
UNION SELECT DISTINCT Null, null, null, null, null, null FROM Productivity ORDER BY Productivity.Product;
It was working fine until I added that small piece. Sample db is attached in case you want to view the table.
Any idea what's wrong?
Thanks!