Skip to Content
0
Former Member
May 13, 2008 at 10:21 PM

How to use date or year as optional parameters

40 Views

Post Author: trish.leppa@johnihaas.com

CA Forum: Data Connectivity and SQL

I have a summary report that the user can either select a date range or the year to get a summary report. I am trying to limit in the actual SQL as I don't want date as one of the columns, otherwise my summary won't work. I could have the year be a column and then have the parameter in a selection formula. But as to the date what would be the syntax in the SQL? What I have for developer is the following, but that does not seem to work.

and trans_date >= nvl(:p_beg_date, trans_date) and trans_date <= nvl(:p_end_date, trans_date)

I am a newbie on Crystal Reports using version 2008 so any suggestions would be appreciated.

Thanks,Trish Leppa

John I. Haas, Inc