Which is correct? PI_NO is a REF to to a table where PI_NO is the key with a number type. I know that is not the best to use for a key but the admin will always control this and it will only be changed at the data source.
OR([PI_NO]=1,[PI_NO]=2,[PI_NO]=3,[PI_NO]=4)
OR([PI_NO]=“1”,[PI_NO]=“2”,[PI_NO]=“3”,[PI_NO]=“4”)
Are they interchangeable? Are “” only needed if the data type was text?
Solved! Go to Solution.
Strictly speaking, within expressions, quotes are needed only to ensure the value isn’t misinterpreted as a keyword or special character, so 1
and "1"
should be equivalent. To ensure textual values are always interpreted as such, I strongly recommend always quoting textual values. Likewise, temporal values contain special characters that would be misinterpreted, so should also be quoted. Numeric values are unlikely to be misinterpreted, so I don’t recommend quotes for them. Essentially, any raw value that isn’t numeric should be quoted.
Strictly speaking, within expressions, quotes are needed only to ensure the value isn’t misinterpreted as a keyword or special character, so 1
and "1"
should be equivalent. To ensure textual values are always interpreted as such, I strongly recommend always quoting textual values. Likewise, temporal values contain special characters that would be misinterpreted, so should also be quoted. Numeric values are unlikely to be misinterpreted, so I don’t recommend quotes for them. Essentially, any raw value that isn’t numeric should be quoted.
Oh, and more efficient:
IN([PI_NO], {1, 2, 3, 4})
Great. Thanks for all the info.
As @Steve already stated.
I never put quotes around my numerical values. Unless I explicitly am making them a part of some other text.
User | Count |
---|---|
39 | |
28 | |
23 | |
23 | |
13 |