Results 1 to 2 of 2

Thread: SQL+DateDiff

  1. #1
    Romayne Guest

    Default SQL+DateDiff

    I noticed that GetDate function is not recognised in SQL, only recognised in SQL Server. I am using SQL coding not SQL server, I want to delete if more than 10 messages are stored in the database. I realised that trigger events is not used in Access and in Visual Interdev, I used this SQL program:<BR><BR>Set DbConn = server.CreateObject("ADODB.Connection")<BR>DbConn. Open "PDMODULES"<BR><BR>SQLQuery = "DELETE * FROM BULLETIN " &_ <BR> " WHERE DATEDIFF(day,Insert_Date,GetDate()) &#062; 10 "<BR> <BR>DbConn.Execute(SQLQuery)<BR><BR>The GetDate() function is not recognised, so what function does SQL use? <BR><BR>Can anybody correct it for me?

  2. #2
    Sean Baird Guest

    Default RE: SQL+DateDiff

    You&#039re using an Access database, correct? <BR><BR>SQL is just a language... database engines provide the functions (like getdate() in SQL Server), so they differ based on which database you&#039re using. Try looking in Access help under NOW()... I think that should do what you want.<BR><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