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!

Formatting Field in Crystal 8.5 1

Status
Not open for further replies.

Yeseniah

MIS
Sep 28, 2005
8
US
Hi.

I would like to format a field so that it only prints amounts for money expected in the current month. I have the following formula in the "Suppress" section of the Format Editor:

//Only show amounts for $$ expected in current month
If Month({TEMPUS_OPP.DEPOSIT_ORIG_DATE}) = Month(currentdate)
Then
{TEMPUS_OPP.DEPOSIT_AMOUT} = {TEMPUS_OPP.DEPOSIT_AMOUT}
Else
True

However, this seems to be suppressing all data. Is there something wrong with my data?

Thanks in advance.
 
Try simplifying with the following:

Month({TEMPUS_OPP.DEPOSIT_ORIG_DATE}) < Month(currentdate)

Do you need to check for year as well?

MrBill
 
Yes, need to check for year as well. Is this the correct selection for that?

Thank you.
Yesenia
 
MrBill,

I appreciate your help and tried the formula you suggested, however it is still pulling amounts for amounts other than current month. Ex. I got amounts for deposits expected in Nov. & Dec. Do you know why that could be?

Thank you.
Yesenia
 
If you only want the current month/Year try:


Month({TEMPUS_OPP.DEPOSIT_ORIG_DATE}) = Month(currentdate) and Year({TEMPUS_OPP.DEPOSIT_ORIG_DATE}) = Year(currentdate)

MrBill
 
Or

Assuming you have {TEMPUS_OPP.DEPOSIT_AMOUT} "Suppressed", then click on the x+2 button and enter the following

Code:
if cstr({TEMPUS_OPP.DEPOSIT_ORIG_DATE},"yyyyMM") = cstr(currentdate,"yyyyMM") 
then 
  False
else
  True

-lw
 
Thank you kskid! I did have this suppressed and your solution works perfectly!

Thanks!
Yesenia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top