Undefined function 'GETDATE' in expression (Ms access connection)

  • Thread starter Thread starter Bajtitou
  • Start date Start date
B

Bajtitou

Guest
Hi ,

I am using an Ms access database ,

with this Function I whant to get dates which happened to day,

But I always get :"Undefined function 'GETDATE' in expression" exception is occurent "type 'System.Data.OleDb.OleDbException'".

Thank you so much.

Public Function GetDateMirage1() As DataTable
Dim dt As New DataTable

Dim selectStatement As String =
<SQL>

Select PID,Cage,Race

,DatedePonte
,DatedeCouvaison
,DatedeMirage
,Datedéclosion
From Ponte1 WHERE (DatedeMirage >=DATEADD(day, DATEDIFF(day,0,GETDATE()),0)
AND DatedeMirage &#60;DATEADD(day, DATEDIFF(day,0,GETDATE())+1,0))


</SQL>.Value

Using con = New OleDbConnection(cs)
Using cmd = New OleDbCommand() With
{
.Connection = con,
.CommandText = selectStatement
}
con.Open()

dt.Load(cmd.ExecuteReader())

End Using
End Using

Return dt

End Function

Continue reading...
 
Back
Top