CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft OLE DB Provider for SQL Server error '80040e14' - 'now' is not a recognized built-in function name.

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    4244
  • Date Created
    Thursday, April 21, 2022
  • Last Updated
    Thursday, April 21, 2022
  • This Article Has been Viewed
    503 times
  • Short Desc
    Using date format in SQL Server with the wrong date code will give the error that 'now' is not a recognized built-in function name.
  • Details
    When running code in SQL Server you may encounter the following error.

     
    Microsoft OLE DB Provider for SQL Server error '80040e14'
    'now' is not a recognized built-in function name.
    /Load.asp, line 115
  • Recreate Issue
    Using now() in SQL Server will give the error.
    Now() is used only in Microsoft Office Access Database.
  • Resolve Issue
    In Microsoft Access Database, we use the following to format our date as a Timestamp.

    DATEDIFF('s', LoadDate, now()) as timestamps
    We are comparing our ColumnName of LoadDate with the Access Date function of NOW() to get a timestamp.
    The following lines broking up are.

    LoadDate = 2022-04-18 00:00:00.000
    now() = 2022-04-21 23:09:56.137
    timestamp = 342596


    HOWEVER, in SQL Server, we have to use its built-in function, getdate().
    DATEDIFF(second, LoadDate, getdate()) as timestamps