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

Multiple parameters in date comparison

Status
Not open for further replies.

posiedon

Programmer
Mar 22, 2002
8
0
0
GB
Hi

i have a series of user parameters that i would like to 'build' a date from for a comparison against a date field in a table.

the parameters are &dd, &mon, &yyyy, &hh24 and &mi.
how can i put them together in the format &dd:&mon:&yyyy:&hh24:&mi:00 in order to use them in a date comparison ie

select ....
from ....
where events.eventdate >= (TO_DATE('&dd:&mon:&yyyy:&hh24:&mi:00','DD:MON:YYYY:HH24:MI:SS'))

can i just put them together in the format above, or is there something else i have to do??

TIA

Stephen
 
I assume you are dealing with SQL*PLUS user variables - in which case what you have should work.

If you are using bind variables or PL/SQL variables you have to build your string using the || concatonation operator.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top