Results 1 to 2 of 2
  1. #1
    Robert2150 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Sep 2013
    Location
    Sparks, Nv
    Posts
    104

    Error in Query, The expression you entered contains invalid syntax

    I have a query where I am calculating the ITEM AGE of an item.



    ITEM AGE: DateDiff("yyyy",[SSMA$SQFT/LF ITEMS]“DATEACQUIRED”,Now()) by using an existing field in the table:
    The field used in the calculation is "DATE ACQUIRED"
    The table name is SSMA$SQFT/LF ITEMS

    I keep getting the error that I may have entered an operand without and operator.

    I have worked on this for quite a while to no avail.

    What obvious thing am I missing?

    Thank you for your help in advance.


  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Your syntax is wrong,

    Try
    Code:
    ITEM AGE: DateDiff("yyyy", DATEACQUIRED, Now())
    The table needs to be in the query for this to work.


    BTW, a table name of "SSMA$SQFT/LF ITEMS" is a horrible name!
    You have a space, the dollar sign and a slash in the name.

    Good naming rules to follow:
    Use only letters and numbers (exception is the underscore) for object names.
    Do notuse spaces, punctuation or special characters in object names.

    Object names are field, query, form and report names.

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

Similar Threads

  1. the expression '|' you entered is invalid
    By skippy in forum Access
    Replies: 11
    Last Post: 06-08-2019, 02:57 PM
  2. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  3. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Replies: 13
    Last Post: 12-05-2011, 05:10 AM

Tags for this Thread

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