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!

Help on Date (Year) parameters in Crystal 8

Status
Not open for further replies.

cheerfulskeptic

Programmer
Feb 3, 2003
88
IN
I have a designed report that shows data for the year 2000 (hard coded). I inserted a paramter that prompts for the year. However, when I use the SQL Editor to edit the 'where' clause of the report to put in the following:

{table.field} in Date ({?reportyear}, 01, 01) to Date ({?reportyear}, 12, 31)

but it doesnt work. How do I insert the report year parameter into the selection criteria?

Thanks in advance
 
Use Report->Edit Selection Formula->Record and place something like:

{table.field} >= cdate({?reportyear}, 01, 01)
and
{table.field} <= cdate({?reportyear}, 12, 31)

Crystal will build the SQL for you.

-k kai@informeddatadecisions.com
 
Thanks for the reply for the crystal reports. Unfortunately when I use the cdate using the formula editor in the Select expert, it gives me an error &quot;Too many arguments have been given to this function&quot;

What data type should the parameter reportyear be?

Thanks for your hep.
 
Numeric.

Don't bother with the select expert, from the menu use:

Report->Edit Selection Formula->Record

Generally the term Expert means here's a way to cheat something, and doesn't have the extensibility that other means might offer.

-k kai@informeddatadecisions.com
 
Thanks. I defined the year as a number and the report works great.
One more question. its more of a db question i suppose related to joins .... I have table FCE and table PROCTIME.
the keys related in these two tables are FCE.FCEPRESENT and PROCTIME.FCEPRESENT.
there are hundreds of records in PROCTIME and each record in FCEPRESENT in unique.
My report counts the occurences of FCEPRESENT in PROCTIME and displays them. However, if there are no occurences in PROCTIME it should print a zero but still show the name. Currently, it is not displaying the name if the # of occurences are zero. Its a matter of joins, I think. What do you think is a quick way to display the zero occurence records from PROCTIME?
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top