Harry Shmedlap
Registered User.
- Local time
- Today, 19:27
- Joined
- Aug 9, 2005
- Messages
- 51
I want a column in the query to be used for sorting but it depends on the type of data. In preparing to use my tables, I used a simple conditional formula:
sortField: IIf(IsNumeric("123"),CDbl("123"),"123")
Given that the test condition discovered that the data is numeric, the result is the data typed as double. Yet the result is left-justified, showing that the datatype is NOT numeric.
Then when I do it explicitly:
good: CDbl("123")
I do get a right-justified numeric field.
Why doesn't IIF() return the value as a numeric type?
sortField: IIf(IsNumeric("123"),CDbl("123"),"123")
Given that the test condition discovered that the data is numeric, the result is the data typed as double. Yet the result is left-justified, showing that the datatype is NOT numeric.
Then when I do it explicitly:
good: CDbl("123")
I do get a right-justified numeric field.
Why doesn't IIF() return the value as a numeric type?