Question on if/then statement, getting an error
? I am having an issue on an if/then statement in Report Explorer and I
am not sure why. I am on the Design tab and adding a calculation to a
variable.
Here is my statement:
if (DBCalc2.Value-Query['QTY_NEEDED']) > Query['QTY_AVAIL'] then
Value := Query.['QTY_AVAIL']
else
if (DBCalc2.Value-Query['QTY_NEEDED']) < 0 then
Value := 0
else
Value := (DBCalc2.Value-Query['QTY_NEEDED']);
When I try and compile it, I get:
Error: Variable1OnCalc, Line 2: Expected: '(' or '[', but found '['
instead.
Really that doesn't make any sense.
Thanks in advance for any help.
--- posted by geoForum on http://www.newswhat.com
am not sure why. I am on the Design tab and adding a calculation to a
variable.
Here is my statement:
if (DBCalc2.Value-Query['QTY_NEEDED']) > Query['QTY_AVAIL'] then
Value := Query.['QTY_AVAIL']
else
if (DBCalc2.Value-Query['QTY_NEEDED']) < 0 then
Value := 0
else
Value := (DBCalc2.Value-Query['QTY_NEEDED']);
When I try and compile it, I get:
Error: Variable1OnCalc, Line 2: Expected: '(' or '[', but found '['
instead.
Really that doesn't make any sense.
Thanks in advance for any help.
--- posted by geoForum on http://www.newswhat.com
This discussion has been closed.
Comments
It looks like on the second line you have Query.['QTY_AVAIL']. There
should not be a dot between the pipeline name and the field name.
Try Query['QTY_AVAIL'] instead.
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
hour and couldn't figure out what I was doing wrong, sometimes it just
takes another set of eyes.
--- posted by geoForum on http://www.newswhat.com