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

Setting Date parameters in Crystal 1

Status
Not open for further replies.

lana123

Programmer
Aug 20, 2003
79
US
Hi,people.
I'm setting Date parameter in range from Crystal 9.2.2 to Oracle database.I want to get the date range which I require or I don't need see Date in my selection.
But when I don't choose any date for my Date parameter I'm getting the strange default range in Select statment.
This is the formula:

(if (({?Date})<> Date(0,0,0)) then
{?Date} = {TABLE.MY_DATE}
else
true)

I'll appreciate if anybody has any idea how to change the formula that doesn't select any date if I don't need it.
Thanks a lot.

Lana
 
Set a default value of cdate(1970,1,1) (or whatever makes sense), and then use:

(
if minimum({?Date}) <> Date(1970,1,1)) then
{TABLE.MY_DATE} = {?Date}
else if minimum({?Date}) = Date(1970,1,1)) then
true
)

This assumes that you truly are using a date &quot;range&quot; parameter.

Note that fully qualifying the ELSE helps to assure the SQL is passed to the server.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top