Results 1 to 2 of 2
  1. #1
    ewassmer is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    20

    DateDiff Missing Operator? Long Query

    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!

  2. #2
    ewassmer is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    20
    Missing a parenthese. Problem solved, sorry everyone. Still new to Access!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 08-19-2011, 09:06 AM
  2. Unable to fix a missing operator error
    By dhaneshjs in forum Access
    Replies: 6
    Last Post: 05-25-2011, 10:14 AM
  3. Error 3075 Missing Operator
    By KLynch0803 in forum Queries
    Replies: 5
    Last Post: 02-11-2010, 01:13 PM
  4. Replies: 1
    Last Post: 10-07-2009, 07:36 AM
  5. Missing Operator error
    By data123 in forum Forms
    Replies: 1
    Last Post: 03-15-2009, 04:34 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums