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!

Manual Xtab conditional formatting not working 2

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
I have to put conditional formatting around all of my running total fields, the problem I'm having is converting the results to a string. I'm getting the error "The ) is missing" for {#FS MFF} first one

Here's the complete code:

if{@Product Type}like "*MozzPS*" and (totext(val{#FS MFF} in "000" to "62.10")then crRed else
if{@Product Type}like "*MozzPS*" and (totext(val{#FS MFF} in "63.81" to "1000")then
crRed else CrWhite

thanks


-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Try -
Code:
if {@Product Type} like "*MozzPS*" and totext(val({#FS MFF})) in "000" to "62.10" then crRed else 
if {@Product Type} like "*MozzPS*" and totext(val({#FS MFF})) in "63.81" to "1000" then 
crRed else CrWhite

You need () around the object of the Val function, and move the final ) from after the higher value in your ranges, to immediately after the val function
 
Thanks, the error went away but my result 63.64 is red and shouldn't be? Any thoughts?

thanks

Here's the code I'm using now

if {@Product Type} like "*MozzPS*" and totext(val({#FS MFF})) in "000" to "62.10" then crRed else
if {@Product Type} like "*MozzPS*" and totext(val({#FS MFF})) in "63.81" to "1000" then
crRed else CrWhite

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Hi,
I have determined that crystal is ignoring the beginning of the code, ~if {@Product Type} like "*MozzPS*"~ I've treid like, in square brackets grrrr, nothing is working! Once I get the beginning right I can run with it.

thanks for any help you can give me.

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
did you try parenthesisizing each little bit, like this?
sometimes this will help narrow down issues (or if i misplace the parenthseis', sadly cause issues)


if
(
({@Product Type} like "*MozzPS*")
and
(totext(val({#FS MFF})) in "000" to "62.10")
)
then crRed
else
(
if
(
({@Product Type} like "*MozzPS*")
and
(totext(val({#FS MFF})) in "63.81" to "1000")
then
crRed
else CrWhite
)
)
 
Thanks,
It's still ignoring the

if
(
({@Product Type} like "*MozzPS*")

I have 4 different product types in the report and its turning all of them to red. They are out of the range as defined in the code, but I have to define the ranges for those other products later.

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
regarding your like statement, you should make sure the case of the field matches the case used in the formula. I also would NOT use text for the values, but instead would write this like:

if {@Product Type} like "*MozzPS*" and
val({#FS MFF}) in 0 to 62.1 then crRed else
if {@Product Type} like "*MozzPS*" and
val({#FS MFF}) in 63.81 to 1000 then
crRed else
CrWhite

-LB
 
You're me hero

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top