I'm missing something REALLY simple! (1 Viewer)

dcavaiani

Registered User.
Local time
Today, 11:43
Joined
May 26, 2014
Messages
385
I have a report reading from a query. I have a column with defined as alpha which has mostly characters in, but on certain rows (with "Daily" in field1, there are some totals, left justified, e.g., 0.5 and 2.5

I keep getting a "data mismatch" using" =IIf([field1]="Daily" And Not IsNull([sainx]),Sum(Val([sainx])),

I see it is likely trying to somehow sum the rows with actual alpha data in them

Also wondering if I need to sum up a "dummy" field in the detail section, and then reference that field in the report footer, or cud the code just be placed into the report footer ?
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 09:43
Joined
Oct 29, 2018
Messages
21,358
Hi. Are you saying [field1] is a Text field? What about [sainx]?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 12:43
Joined
Feb 19, 2002
Messages
42,971
The obvious solution is to stop mushing text and numbers in the same column. If you want to do arithmetic with a number, you need to store it in a numeric field.
 

dcavaiani

Registered User.
Local time
Today, 11:43
Joined
May 26, 2014
Messages
385
Field1 sainx
Dates 12/21/2019
Customer Cavi-2
Am 0630
Pm
TOTALS
Daily 0.5
Weekly 30.5
 

dcavaiani

Registered User.
Local time
Today, 11:43
Joined
May 26, 2014
Messages
385
I tried a dlookup and that seems to bypass all errors !
 

Users who are viewing this thread

Top Bottom