locked
Append query returns message: "undefined function "Date" in expression RRS feed

  • Question

  • I am updating my Access 2000 to Access 2016.  My access 2000 has a query to append data including two dates defined as "Date()" for the current date.  I am appending data from one data base to another one.   When I run this query in Access 2016 it returns a message: " Undefined function 'Date' in expression."  Is the Date() function from Access 2000 not supported in Access 2016?

    Here is the SQL:  

    INSERT INTO Expenses ( [Addr Code], Vendor, [Expense Code], Amt, [Inv Date], [Date Entered] ) IN '\\guy\access\db1.mdb'

    SELECT "XSM" AS [Addr Code], "FICAme" AS Vendor, "Tax" AS [Expense Code], [FICAme Total].SumOfFICAme, Date() AS [Inv Date], Date() AS [Date Entered]

    FROM [FICAme Total];

    Thank you for your help,

    Guy

    Wednesday, August 2, 2017 10:18 PM

All replies

  • Hi Guy, Date() is still supported; however, broken references due to newer versions of Access break some internal functions. Check your VBA references and fix any missing ones. Hope it helps...
    Wednesday, August 2, 2017 10:28 PM
  • You might try Now() instead of Date().
    Wednesday, August 2, 2017 11:19 PM
  • I agree with theDBguy this sounds like a classic case of broken VBA references.

    Go into the VBA Editor (VBE) and Under Tools select References... then examine the list and look for any where it is specified MISSING. You need to remove/replace those reference libraries. Always ensure your VBA project compiles without any errors and then try you query again.


    Daniel Pineault, 2010-2017 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net


    Wednesday, August 2, 2017 11:41 PM
  • Hi gsdevel,

    Has your original issue been resolved? If it has, I would suggest you mark the helpful reply as answer or provide your solution and mark as answer to close this thread. If not, please feel free to let us know your current issue.

    Best Regards,

    Terry

    Monday, August 14, 2017 9:30 AM