SQL + DATEDIFF + HELP NEEDED.

Results 1 to 2 of 2

Thread: SQL + DATEDIFF + HELP NEEDED.

  1. #1
    Romayne Guest

    Default SQL + DATEDIFF + HELP NEEDED.

    Hi,<BR><BR>I am trying to delete messages that are ten days old from the Access Database. I keep getting this error all the time:-<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e10&#039 <BR><BR>[Microsoft][ODBC Microsoft Access 97 Driver] Too few parameters. Expected 2. <BR><BR>/MODULESDB/PAGES/confirm.asp, line 27 <BR><BR><BR>I am using VisualInterDev and Access Database and SQL. I am not using SQL SERVER!.<BR><BR>Can you please correct the coding for me? What alternatives?<BR><BR>SQL = "DELETE * " &_<BR> "FROM BULLETIN " &_<BR> "WHERE (DATEDIFF(day,Insert_Date,GetDate())&#062;10) " <BR> <BR>DbConn.Execute(SQL)<BR><BR>Insert_Date is the field from Access.<BR>GetDate() function is not recognised in SQL except in SQL SERVER.<BR><BR>Thanks.<BR>

  2. #2
    Stephan Zutterman Guest

    Default RE: SQL + DATEDIFF + HELP NEEDED.

    You should try ...<BR><BR>SQL = "DELETE * " &_<BR>"FROM BULLETIN " &_<BR>"WHERE (DATEDIFF(&#039d&#039,Insert_Date," & date & ")&#062;10) "<BR><BR>instead of ...<BR><BR>SQL = "DELETE * " &_<BR>"FROM BULLETIN " &_<BR>"WHERE (DATEDIFF(day,Insert_Date,GetDate())&#062;10) " <BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •