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

Display Record Selection Criteria on Report

Status
Not open for further replies.

RhodeScape

IS-IT--Management
Jun 16, 2009
6
US
Hi Folks - I used Record selection to set date criteria from 1/1/2008 thru 12/31/2008. Is there a way to "pass" Record Selection criteria for display on the report. Thanks.

Rhode
 
OK ... I found the Record Selection Formula Special Field. It comes close, but is there a way to select portions of the formula and insert them into a text box?

Thanks.
 
Are you using parameters? Or hard coding the dates?

-LB
 
Yes, if you input parameters then use them in the formula, you simply print them on the report, typically header or footer area.

If you are hard coding the date, STOP THAT!
 
Yes, I am hard-coding the dates. I didn't feel that a parameter was the way to go because for this particular report the dates are always the same (yearly report). I thought if I used parameters, I would be prompted every time I want to run the report. Is there a way to use parameters without the prompts? Thanks.
 
Follow-up ... I know how to setup a date range using parameters that will prompt for input, but how would I reference the start date and end date individually? And, can I suppress the prompt? I'm relatively new to CR, so bear with me. Thanks.
 
Parameters by definition require user input. If you are always running the report for a specific year, you can use functions to automatically pull the correct year. For example, if you always wanted data for the last full calendar year, then you could use a record selection formula like:

{table.date} in date(year(currentdate)-1,1,1) to date(year(currentdate)-1,12,31)

Then you could easily use a formula like the following to display the appropriate dates:

totext(date(year(currentdate)-1,1,1),"MM/dd/yyyy")+" to "+ totext(date(year(currentdate)-1,12,31),"MM/dd/yyyy")

-LB
 
Thanks ... I have an Access background. In Access, I could enter dates in a form, then pass (reference) those values to a text field on the report. I'll just have to get used to the CR way.

 
How is entering dates in a form different from responding to a parameter prompt? That would be the simplest approach--using parameters and then using formulas to capture their values.

-LB
 
In concept, there is not much difference, but in Access I am able to accept dates, and reference those dates discretely, rather than building a formula to reference dates indirectly, as was recommended. Thanks for everyone's help. I've got a long learning curve ....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top