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

Passing variables 1

Status
Not open for further replies.

spiego

MIS
Aug 16, 2004
80
US
Is it possible to pass a variable within the main report? If so, how? I have a formula in the report header to calculate the current month. I would like to capture the number of the month and use it in another formula within a group.

I am using CR 9.0.
 
Try:

whileprintingrecords;
Numbervar MyMonth := month(currentdate)

To use it later, use:

whileprintingrecords;
Numbervar MyMonth;
"This is month "+totext(MyMonth,0,"")

There's no reason to use a variable to calculate the current month though, unless your report runs so long that the month changes ;)

Just use month(currentdate) to get the current month whenever you need it, it's less code.

I provided the above example so that you can see how to use variables within the main report.

-k

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top