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

Help with report expression 1

Status
Not open for further replies.

dianemarie

Instructor
Jul 11, 2001
583
US
Hello, I have an if/then/else expression that returns an integer. It works fine:

exp1: xQtyShipElseBook:
=iif(Fields!QtyShip.Value > 0,Fields!QtyShip.Value,Fields!QtyOrd.Value)

I want to use this expression as a field in another if/then/else expression, again returning an integer. I have copied the second expression, as well as the error. Can anyone see what's wrong? Should I rewrite these two expressions as on block of custom code instead? Thank you for any guidance, or um....code to copy. :)

exp2: xQtyCurrent (I'm comparing data over a 2 year period)
=iif(Fields!xQtyShipElseBook.Value >= Parameters!CurrentStart.Value
and Fields!xQtyShipElseBook.Value <= Parameters!CurrentEnd.Value,
Fields!xQtyShipElseBook.Value,0)

Error message: (the report runs, but I return nothing in the field for xQtyCurrent - the first expression is not on the report canvas.)
[rsRuntimeErrorInExpression] The Value expression for the field ‘xQtyShipElseBook’ contains an error: Operator '>=' is not defined for type 'Integer' and type 'Date'.
Preview complete -- 0 errors, 1 warnings




 
You're saying If SomeInteger >= SomeDate Then... You need to compare a numeric data type against another numeric, or a date against a date.
 
Well for the love of Pete. I totally screwed that up. It's supposed to be:

=iif(Fields!OrdDate.Value >= Parameters!CurrentStart.Value
and Fields!OrdDate.Value <= Parameters!CurrentEnd.Value,
Fields!xQtyShipElseBook.Value,0)

I've been staring at it forever and never saw it. Thanks for turning on the light! (I'm blaming a long, hard week.)
 
I've been there plenty of times, sometimes all it takes is another set of eyes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top