Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

VB.net and SQL query on date field

412980Jan 20 2004 — edited Jan 21 2004
I have a sql query that compares date on Oracle. The field is defined as Date type in Oracle and format is mm/dd/yyyy. My date format in VB is mm/ddd/yyyy. In my VB code I want to select reords that are older than 5 days. Here is the VB code:

Dim DateBack As Date
DateBack = DateAdd("d", -5, Today)
SqlString = "Select * from PIF_Table"
SqlString = SqlString & " WHERE marketingsignaturedate<'" & DateBack & "'"

When I execute the code I get an OleDb error like:
An unhandled exception of Type 'System.Data.OleDb.OleDbException' occurred in system.data.dll

My code works fine selecting other fields that are not defined as Date type. Any help is highly appreciated. Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 18 2004
Added on Jan 20 2004
1 comment
417 views