AnneMartin
Qrew Trainee
2 years ago

# Type mismatch

This is to calculate a bonus for our technicians based on how many hours they bill. Some technicians get an additional bonus for hours worked on refrigeration equipment and some don't.
I'm getting a type mismatch from my IF statement, so I added a tonumber but am still getting the same error. Any ideas?
I've tested the parts of my formula separately and they work as far as I can tell, it's just the IF statement that's giving me grief.

If([Refrigeration Rate]="",

------------------------------
Anne Martin
------------------------------

### 2 Replies

• can you post your whole formula?

------------------------------
mark.shnier@gmail.com
------------------------------
• Do I need to change the variable to a number?

//Labor Codes FID 14 = technician, FID 17 = hours per tech
//Query FID 42= technician, FID 12 = quantity, FID 16 = Month, FID 9 = item
//_DBID_QSALESHISTORY, FID 22 = technician, FID 20 = GL date, FID 23 = actual quantity, FID 16 = category, FID 15 = description FID 25 = labor category

var text myquery= "{20.GTE.'"&[First of Month]&"'} AND {20.LTE.'"&[Last of Month]&"'} AND {22.CT.'"&[User to text]&"'} AND {25.EX.'Regular'}";
var text aquery= "{20.GTE.'"&[First of Month]&"'} AND {20.LTE.'"&[Last of Month]&"'} AND {22.CT.'"&[User to text]&"'} AND {25.EX.'Refrigeration'}";