Identifying decimals in a calculated IIF statement

VbAaron

Registered User.
Local time
Today, 18:09
Joined
Feb 28, 2013
Messages
21
Hello I have a statement as follows:

Code:
ohc: IIf(([oh]/[csqty])>1,[oh]/[case_qty] & " (LTSU?)",[oh]/[case_qty])

The intention was that it would add " (LTSU?)" to the calculated number where it was less than 1 (or not a whole number). Stupidm, me didnt account for fractions greater than 1 (ie 1.566). Just wanted to know how I can identify all 'non-whole' numbers in the above IIF statement.

Thanks.
 
Is it matter of only identifying the decimal point in the calculation or for anything between 0 and 1? If it is just identifying decimal, you can use the InStr function.
Code:
ohc: IIf(InStr([oh]/[csqty], ".") <> 0, [oh]/[case_qty] & " (LTSU?)", [oh]/[case_qty])
 
Ahhhhhh yeeeaaa. Thanks for the reply. Had a feeling that it was something so simple. Have a good one.
 
implicit conversion from a number to a string :(

Why not use a mod(...,1) to find any fraction?
 

Users who are viewing this thread

Back
Top Bottom