Results 1 to 2 of 2
  1. #1
    derek7467 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Posts
    46

    Query Expression Help

    Hey guys, im trying to build a query expression but keep getting a syntax error. Can someone spot check my query?



    AUSun: (SELECT TOP 1 Dupe.Agent Utlization FROM qAgent Utilization as Dupe WHERE Dupe.NovellID = qAgent Utlization.NovellID AND Dupe.openDate = (DateAdd("d",7-(Weekday(Format(Forms!fAvayaWeeklyReport!dDate,"mm/dd/yyyy",1,1)))-6,Format(Forms!fAvayaWeeklyReport!dDate,"mm/dd/yyyy",1,1))) ORDER BY Dupe.openDate DESC, Dupe.NovellID)

    Is the above written correctly?

    I basically have a pool of data based on weekday, what i want to do is call a set of data per day:

    Sunday: Data
    Monday: Data
    and so on and so on...

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Field and object names with spaces or special characters/punctuation (underscore is exception) or are reserved words must be enclosed in [].

    Possible typos in spelling Utilization (missing first 'i').

    Try:

    AUSun: (SELECT TOP 1 Dupe.[Agent Utilization] FROM [qAgent Utilization] as Dupe WHERE Dupe.NovellID = [qAgent Utilization].NovellID AND Dupe.openDate = (DateAdd("d",7-(Weekday(Format(Forms!fAvayaWeeklyReport!dDate,"mm/dd/yyyy",1,1)))-6,Format(Forms!fAvayaWeeklyReport!dDate,"mm/dd/yyyy",1,1))) ORDER BY Dupe.openDate DESC, Dupe.NovellID)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  2. Replies: 4
    Last Post: 10-26-2012, 12:49 AM
  3. Query Expression Help
    By hmartin in forum Queries
    Replies: 7
    Last Post: 01-21-2012, 11:37 PM
  4. Query Expression
    By nizam in forum Queries
    Replies: 1
    Last Post: 11-12-2011, 02:56 PM
  5. Expression for Query Help
    By fikeplay in forum Access
    Replies: 1
    Last Post: 07-09-2011, 05:12 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