Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have written a VB.NET program that interfaces with a Microsoft Access database. Now my problem lies when I try to execute an SQL statement using a date/time field in the where clause of the SQL statement. It keeps giving me the error of invalid SQL statement. Below is a copy of the SQL statement I am using any help would be greatly appreciated.

 

Dim datefirst As Date

Dim datelast As Date

Dim StrWhere As String

Dim appAccess As New Access.Application()

 

datefirst = CDate(flddate.Text)

datelast = CDate(flddatelast.Text)

StrWhere = "SELECT * FROM Daily WHERE Daily.date >= #datefirst# AND Daily.date <= #datelast#"

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...