Expression Field in a query treat as number (1 Viewer)

basshead22

Registered User.
Local time
Today, 13:04
Joined
Dec 17, 2013
Messages
52
Hello All,

It's been awhile since i wrote in here.

Here is my scenario. I have a query that has several IIF statements based on the FTE count. I want the return result to be formatted as a number so when i do my total field it gives me back the correct number. Right now if i do a total based off the results it doesn't treat the results as a number it pretty much just concatenates both fields.

example Field #1
Program FT: IIf([PM_PC_PROGRAM]="Program" And [FTE]=1,"1","0")
Result = 1

example Field #2
Program PT: IIf([PM_PC_PROGRAM]="Program" And [FTE]<1,[FTE],"0")
Result = 1

Example Field #3
Total FTE: [Program FT]+[Program PT]

Results = 1.1 Instead of 2

Please help !!! i'm breaking my head all morning!!! :banghead:
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 13:04
Joined
Aug 30, 2003
Messages
36,127
Don't surround your values with quotes.
 

basshead22

Registered User.
Local time
Today, 13:04
Joined
Dec 17, 2013
Messages
52
That easy huh pbaldy!!!!!Thanks so much!!! exactly what i needed to do!!!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 13:04
Joined
Aug 30, 2003
Messages
36,127
Happy to help! By the way, I answer to wino too. ;)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:04
Joined
Feb 19, 2002
Messages
43,314
Surrounding numbers with quotes turns them into strings. The + operator cannot add strings so it performs its other function which is concatenation.
 

Users who are viewing this thread

Top Bottom