Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can't pass dates to Oracle

Status
Not open for further replies.

Elysium

Programmer
Aug 7, 2002
212
0
0
US
I have searched this site for an answer to my question, so if I overlooked something or didn't use the right key words, forgive me.

Here's my problem: I am using VB6 and I am trying to connect to an Oracle database. My SQL is restricted with date ranges, the standard Start and End, but I am getting an error.

The WHERE clause looks like this:
&quot;WHERE ((Account_Detail.Account_Start_Date) >= to_date('11/03/2002','mm-dd-yyyy') AND (Account_Detail.Account_Start_Date) <= to_date('11/09/2002','mm-dd-yyyy')) AND ((Organization.Region_Num)='04') AND ((Organization.District_Num)='74')&quot;

The error that comes back reads:
&quot;Unsupported query syntax&quot;

My connection object looks like this:
oConn.ConnectionString = &quot;Provider=MSDASQL.1;Persist Security Info=False;User ID=; Data Source=MyDSN ;Extended Properties='DSN=MyDSN'&quot;

For the life of me, I just can't see it. I need someone from the outside to clue me in. Where am I going wrong? Thank you.
 
Not sure if this will work, but I have used it with an insert query.

&quot;WHERE ((Account_Detail.Account_Start_Date) BETWEEN #11/03/2002# AND #11/09/2002# AND ((Organization.Region_Num)='04') AND ((Organization.District_Num)='74')&quot;


Cheers....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top