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

Setting date and text based upon parameter selection

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CR 10

I want to produce wording as follows depending upon parameter i select (Interim or Annual)

If{?Period}="Interim" then "for the 6 months to X" else for the year to Y

X must allways be the end of June in the year i run the report and Y must allways be the end of year I run the report - and in this format: 30th June 2011

So if interim selection i should get:

for the 6 months to 30th June 2012 if i ran it next year for instance
 
Hi,
you could use a formula like:
@Mytext
Code:
If{?Period}="Interim" then "for the 6 months to 30th June" + ToText(Year(CurrentDate),"yyyy")
Else
"For the year to 31st December " + ToText(Year(CurrentDate),"yyyy")



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Instead of:

ToText(Year(CurrentDate),"yyyy")

You would have to use:

ToText(CurrentDate,"yyyy")

or

ToText(Year(CurrentDate),"0000")

or

totext(year(currentdate),0,"")

...since year is a number. I've made this mistake myself.

-LB
 
Hi,
Good catch LB, thanks.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top