View Full Version : Format Error


DBITGUY
07-13-2010, 06:11 AM
I am very new developer and i'm having formatting issues with an expression. The expression below returns an error message "the Group expression returned a data type that is not valid". My problem is I'm not sure which conversion types to use. Can someone please help?

=(
IIF (Fields!VARIANCE.Value < 0 , (Fields!VARIANCE.Value ),
IIF (Fields!DISCOUNT_VARIANCE.Value < 0 , (Fields DISCOUNT_VARIANCE.Value),
IIF (Fields!TRUE_VARIANCE.Value < 0 , (Fields!TRUE_VARIANCE),(0)))))

vbaInet
07-13-2010, 06:28 AM
Welcome to AWF

I would have thought the word "Variance" is a reserved keyword but it actually isn't.

What are you actually trying to do? Did you put that code in the CONTROL SOURCE of a textbox?

DBITGUY
07-13-2010, 06:40 AM
Yes sir. I've created a variance report that will show the variance totals of 2 different reports. Now I'm trying to group all negative variances and all positive variances and calculate the sum for each at the bottom of the report.

vbaInet
07-13-2010, 06:48 AM
Try this:
=IIF(VARIANCE < 0 , VARIANCE, IIF(DISCOUNT_VARIANCE < 0 , DISCOUNT_VARIANCE, IIF(TRUE_VARIANCE < 0 , TRUE_VARIANCE, 0)))