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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adDBTimeStamp filter problem

Status
Not open for further replies.

KellyK

Programmer
Mar 28, 2002
212
US
Hi all,
I am connecting via ADODB to an Oracle table and need to select records where a particular field is between two dates. This field is of type adDBTimeStamp and I am struggling to find the right syntax to filter on this field. I have tried:
"WHERE LD_DIM.SHP_ARV_DTTM> #05/21/2007 0:00:00 AM# AND LD_DIM.SHP_ARV_DTTM< #5/22/2007 0:00:00 AM#"

but this makes Access crash. I have tried
"WHERE LD_DIM.SHP_ARV_DTTM> #05/21/2007# AND LD_DIM.SHP_ARV_DTTM< #5/22/2007#"

I've tried '5/21/2007', I've tried 21/05/2007, I've tried every conceivable combination of the above. I know that I am able to select the records if I filter on a different field, so my connection and data is ok. However I need to have my filter select by date. Does anybody have recommendations?

Thanks

Kelly
 
I don't know squat about Oracle. However I can tell you that the date delimiters proabably are not # when sending a query to the server. SQL server uses the single quote... If it were SQL server I would try,

"WHERE LD_DIM.SHP_ARV_DTTM > '05/21/2007' AND LD_DIM.SHP_ARV_DTTM < '5/22/2007' "

My advice is to lookup information on ORACLE SQL or ask how to perform the query in an ORACLE forum. You may get lucky and someone yet post a definite answer.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top