IIF in MS Access Reports does not work in ADP Reports

T

T.J. Bernard

I am not sure why, but my IIF function fields will not
work in my ADP reports. I have an IIF set up to determine
if a field is null, and if so, just print that null field,
and if not, concatenate the field with another field.

IIF(IsNull([Volume]), [Volume], [Volume] & " OF " & [OF])

This works just fine in my MS Access reports but not my
ADP reports.

Any ideas?

Thank you,

T.J.
 
R

Rod Scoullar

TJ,

I would have expected the IIf function would work if you are working solely
within the Access program, ie if you are referring to controls within the
report.

If you are trying to use the IIf within the query you will have to
substitute the SQL CASE statement.

IIF(IsNull([Volume]), [Volume], [Volume] & " OF " & [OF])

becomes

CASE [Volume] WHEN NULL THEN [Volume] ELSE CAST(Volume AS varchar(20)) + '
OF ' + [OF] END

This assumes that [Volume] is numeric and [OF] is a character type. The SQL
Server concatenation operator insists that the operands are of character
type and numeric types must be converted.

I hope I have understood your problem and this is of some use.

Rod Scoullar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top