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!

Error message on Varying data types

Status
Not open for further replies.

Shelyn

Programmer
May 15, 2003
18
MY
Hi All,

I received this error message on the reporting:

The value expression for the textbox ‘RoleSR’ uses an aggregate function on data of varying data types.

Here is my expression:

=IIF( Fields!SubtRate.Value = 0, Fields!Scores.Value , (sum( Fields!SubtSR.Value) * Fields!RoleRate.Value) / 100)

So what is actually wrong with my expression? How the data type varied?


Thanks,
Shelyn
 
Looks like a vb or access question rather than a SQL SERVER question, you would probably get a better response if posted in one of them forums.

But initial guess is that the problem is with
(sum( Fields!SubtSR.Value) * Fields!RoleRate.Value) / 100
This will return a possible decimal value and not sure what value is but would guess its an integer.
If you changed your statement to be
Code:
=IIF( Fields!SubtRate.Value = 0, cdbl(Fields!Scores.Value) , cdbl((sum( Fields!SubtSR.Value) * Fields!RoleRate.Value) / 100))
that might work, but as I dont know what program this is run in not sure.


"I'm living so far beyond my income that we may almost be said to be living apart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top