Results 1 to 2 of 2
  1. #1
    gar is offline Advanced Beginner
    Windows 7 32bit Access 2016
    Join Date
    Nov 2011
    Posts
    42

    Syntax error message in domain aggregate function

    This works:
    =DLookUp("[balance]","[t_daily_balance]","[tdate]=[Text37]")


    Both this:
    =DLookUp("[balance]","[t_daily_balance]","[tdate]='DateAdd("d",-1,"[Text37]")'")


    and this:


    =DLookUp("[balance]","[t_daily_balance]","[tdate]=DateAdd("d",-1,"[Text37]")")




    evoke the error message:

    "The expression you entered contains invalid syntax.
    You may have entered an operand without an operator."

    Can anyone put me right?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Try:

    =DLookUp("[balance]","[t_daily_balance]","[tdate]=DateAdd('d',-1,[Text37]")

    Otherwise, concatenate variables. Reference to control is a variable.

    =DLookUp("[balance]","[t_daily_balance]","[tdate]=#" & DateAdd("d",-1,[Text37]) & "#")
    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. Aggregate Function Expression Error
    By spyldbrat in forum Access
    Replies: 4
    Last Post: 05-29-2019, 02:12 PM
  2. Replies: 2
    Last Post: 01-29-2015, 03:07 PM
  3. Replies: 5
    Last Post: 11-19-2012, 01:44 PM
  4. aggregate error due to function
    By boutwater in forum Access
    Replies: 2
    Last Post: 09-26-2011, 03:39 PM
  5. an aggregate function error message
    By newtoAccess in forum Queries
    Replies: 1
    Last Post: 11-27-2010, 05:18 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