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!

Create a New Special Field

Status
Not open for further replies.

madcrystal

Technical User
May 5, 2011
8
US
Is it possible? Alternatively, a formula field that's persistant throughout the main and sub reports? I'm looking to calculate the previous month from the current date and not have to re-create again and again. The formula is not reliant on query data.
 
create a formula using a shared variable (#1) to pass the value to a subreport or you could be rid of the variable and just create the same formula in both main and sub-reports (#2):

#1
//{@currmonthsvar}
shared numbervar cmo := (month(currentdate))-1;

#2
//{@currmonth}
(month(currentdate))-1;

 
You could use:

month(dateadd("m",-1,currentdate))

"month(currentdate)-1" would fail for January dates.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top