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!

Passing Date Parameter into Oracle

Status
Not open for further replies.

Jim318

Programmer
Jul 1, 2002
33
0
0
US
Hello,

I am trying to pass a date parameter in a select statement such as select * from Names where Last_update = To_Date('01/30/2004', MM/DD/YYYY)

When I try to use a variable for the parameter I cannot get the query to execute. For example: select * from Names where Last_update = To_Date(seldate, 'MM/DD/YYYY').

I simply keep getting a syntax error message when I run into my executereader statement.

I'd appreciate any help or advice.

Thanks,
Jim



 
Have you tried To_Date(' & seldate & ', 'MM/DD/YYYY')?
 
Have you tried using ADO.NET parameter objects with the Oracle provider, and passing a DateTime object that contains your date value?

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Still no luck.

I am pulling the date value from the DateTimePicker.

Thanks,
Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top