The only thing it needs to do if it is Null or 0 then provide the value 0.
Right now it only accounts for Null
JobTicket is a numeric value but I'm providing the strings as text cause it's a field design to do sorting on.
If it should go back to numeric instead then I'd put it back. But does that change the syntax as well?
Thank you in advance for your comments!
Microsoft AccessVBA
Last Comment
Mark Edwards
8/22/2022 - Mon
bfuchs
you don't need IsNull for this, use NZ([JobTicket],0)
stephenlecomptejr
ASKER
My question is regarding IIF
Based on the numeric values, I'm sorting so that any 0 or null values get sorted last versus the rest of the values that would have a numeric value between 1-2000.
bfuchs
for that you dont need to use conversion at all, just sort by JobTicket column.
If you are dealing with only numbers as text (nothing but number characters), then you can easily convert to a number data type and that solves the sorting issue:
Val(NZ([JobTicket],0))
Keep in mind that if [JobTicket] is a space or empty string, then Val() will convert to zero.
You can use this formula in a column that you use for sorting if you want to keep the text number column. Just another way of solving the issue of sorting text column as a number, although I'll bet someone will find fault with it because it has one too many characters in it or some other made-up reason.