none
Undefined function "format" in expression RRS feed

  • Question

  • Hi,


    I am using this query in my newly installed access database and getting the error as given in the subject line. This query was working fine in the old access database. Would you please advise me what is wrong with it. Same query is working on other laptops. I have checked trust center settings and all look ok. Please advise me.


    Thanks for your help.



    SELECT FirstDate, LastDate, LocationID_From, Destination, Movement_Type, Grade_Category, Format([CR_Tones],'#,0.00') as Tones, Format([Cr_Ounces],'#,0.00') as Ounces, Format([CR_Grade],'#,0.00') as Grade
    From QRY_ProdDailyCrushedMaterialByDate_Mat

    UNION SELECT 'Total' as FistDate, 'Total' as LastDate, 'Total' as LocationID_From, 'Total' as Destination, 'Total' As Movement_Type, 'Total' As Grade_Category, Format([CR_Tones],'#,0.00') as Tones, Format([Cr_Ounces],'#,0.00') as Ounces, Format([CR_Grade],'#,0.00') as Grade
    From QRY_ProdDailyCrushedMaterialByDate_Total;

    Thursday, June 6, 2019 9:04 AM

All replies

  • You may wish to review your regional settings/code.  For me, but it can be different for you, I need to use double quotes

    Format([CR_Tones], "#,0.00") as Tones

    Secondly, when I get error with basic functions, I always review the References in the VBE looking for any marked as MISSING.


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

    Thursday, June 6, 2019 9:44 AM