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!

Equvivalent to t-sql date parameter report

Status
Not open for further replies.

rogerzebra

Technical User
May 19, 2004
216
0
0
SE
Hi,
I have to ask someone to help me to translate a t-sql date parameter report to a pl-sql (Sql*Plus). This was a while ago I did something in Oracle. All help is much appreciated.
Thanks

Code:
declare @StartDt date
        ,@EndDt
set     @StartDt ='2001-01-01'
set     @StartDt ='2001-02-01'
 
select 
convert(varchar(10), @StartDt, 101) as StartDt
..
where Date between @StartDt and @EndDt
 
Roger,

As a boost to help us get started, can you provide us with a non-technical functional description of what you want to do?

Also, to help eliminate confusion, Oracle's PL/SQL and SQL*Plus are completely separate, syntactically non-similar languages that cannot even execute each other's code...PL/SQL cannot execute any SQL*Plus commands, and SQL*Plus cannot execute PL/SQL code unless it is wrapped inside an EXECUTE command or an anonymous PL/SQL block. The only similarity between the two environments (thus partially leading to all the confusion) is that the letters that spell the names of the two environments are nearly anagramatical.[2thumbsup]

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
“Beware of those that seek to protect you from harm or risk. The cost will be your freedoms and your liberty.”
 
Try replacing the convert function with the Oracle to_char function using the desired format mask. In your example, it would look something like

Code:
declare
StartDt date := '01-Jan-2001';
EndDt   date := '01-Feb-2001';

begin
select to_char(StartDt, 'mm/dd/yyyy') as StartDt
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top