Home » Developer & Programmer » Reports & Discoverer » From_date and to_date issue (10g)
From_date and to_date issue [message #405939] Mon, 01 June 2009 01:14 Go to next message
niopin
Messages: 5
Registered: June 2007
Location: Pune
Junior Member
I need to generate a report where i ll check date parameter
by using between parameter
If using is not giving from date and to date it should not check for the date what query should i write?


select
em.emp_no,
a.lvr_no,
from lvr_leave_detail a,
lvr_master b,
employee_master em
where b.lvr_no = a.lvr_no
and em.emp_no = b.emp_no
and b.start_Date between :frmdate and :todate
and a.leave_type_code = 'S'
and em.company_code = :company_code
and em.company_code = b.company_code
and b.company_code = a.company_code

[Updated on: Mon, 01 June 2009 01:23] by Moderator

Report message to a moderator

Re: From_date and to_date issue [message #405942 is a reply to message #405939] Mon, 01 June 2009 01:26 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:
If using is not giving from date and to date it should not check for the date what query should i write?
Can you elaborate this?

By
Vamsi
Re: From_date and to_date issue [message #405945 is a reply to message #405942] Mon, 01 June 2009 01:37 Go to previous messageGo to next message
niopin
Messages: 5
Registered: June 2007
Location: Pune
Junior Member
if user is not giving any input for date it should check for all dates
Re: From_date and to_date issue [message #405946 is a reply to message #405939] Mon, 01 June 2009 01:38 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Use lexical parameter.

In the After Parameter Form trigger check whether "from" and "to" date have been entered. If yes then lexical parameter would look like
lex_param := 'and b.start_Date between ' || :frmdate || ' and ' || :todate;
Else,
lex_param := 'and 1 = 1'


See Reports Online Help System for more details; also, search the board - there've been topics which show use of lexical parameters quite well.
Re: From_date and to_date issue [message #405949 is a reply to message #405946] Mon, 01 June 2009 01:49 Go to previous message
niopin
Messages: 5
Registered: June 2007
Location: Pune
Junior Member
thank you very much
Previous Topic: how can I prevent user to print report
Next Topic: Oracle Report Output Font
Goto Forum:
  


Current Time: Tue Apr 23 21:38:24 CDT 2024