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

Automatically selecting the Month Prior

Status
Not open for further replies.

Palmbak

Technical User
Dec 17, 2002
25
US
I am posting reports to Crystal Enterprise, is there any formula that I can use that will select the prior month for reporting purposes.

At the month end, we have 30 or so reports with parameters, is there any way I can use a formula instead of a parameter?

Regards,
Jon
 
The following will bring back last month's data:

datediff("M",{your.date.field} ,currentdate)=1 Mike
 
i do not know what Crystal Enterprise is; will this also work in Crystal 8.5?
 
Thanks for the URL Jon! I will check it out ASAP.

ShannonLea [angel]
 
Mike,

Not yet, but it will, you see, I am not writing it against a SQL Database, I am actually writing against a UniVerse Database. The parameters I wish to replace with formulas are {?Year} and {?Month}.

Example:
if {?Month}="1"
then {AT_CLIENT.HRSH_WKD_THRU_MTH1}
else if {?Month}="2"
then {AT_CLIENT.HRSH_WKD_THRU_MTH2}
else if {?Month}="3"
then {AT_CLIENT.HRSH_WKD_THRU_MTH3}
else if {?Month}="4"
then {AT_CLIENT.HRSH_WKD_THRU_MTH4}
else if {?Month}="5"
then {AT_CLIENT.HRSH_WKD_THRU_MTH5}
else if {?Month}="6"
then {AT_CLIENT.HRSH_WKD_THRU_MTH6}
else if {?Month}="7"
then {AT_CLIENT.HRSH_WKD_THRU_MTH7}
else if {?Month}="8"
then {AT_CLIENT.HRSH_WKD_THRU_MTH8}
else if {?Month}="9"
then {AT_CLIENT.HRSH_WKD_THRU_MTH9}
else if {?Month}="10"
then {AT_CLIENT.HRSH_WKD_THRU_MTH10}
else if {?Month}="11"
then {AT_CLIENT.HRSH_WKD_THRU_MTH11}
else if {?Month}="12"
then {AT_CLIENT.HRSH_WKD_THRU_MTH12}
 
just to bug yall again... will it work against an oracle 8.1 database?

( i swear i am going to learn more about the back side of things when / if this side of things calms down...)

shannon [noevil]
 
Will what work against Oracle 8.1? =)
Enterprise or formula?


Jon
 
Enterprise will, but the cost is phenomenal ($45,000) for a server license. If you need a cheap way of emailing out your reports, let me know. (jppalmbak@llgm.com)

The formula looks pretty standard, I believe that will work as well; if I am incorrect in my assumption, please step in.
 
Yup, Ido Millet has an application called "Visual CUT" which is real cheap and an all around "awesome" product.


Highly recommended!!!!!


Cheers,

Jon
 
i just came across something... there is a function in Crystal for this exact purpose which is alot simpler... next time you are trying something where you need the complete month prior... all you have to do is type in something like this example:

{case.casedate} in LASTFULLMONTH

this has been a God send to me as we also have around 30 reports to run at month end - and even more at quarter end and so on...

hope this helps someone :) [americanflag] ShannonLea [americanflag]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top