You need to sign in to do that
Don't have an account?
Can I compare numeric values from an auto number data type field in an SQL query?
I have to iterate between thousand of records and I was thinking of using a uniqueid field that I have, but I cant use the numeric value of it. Seems its treated like string. Is there any way that I can compare numeric values with auto number values?
AND (uniqueid__c > i AND uniqueid__c < i+5000)
AND (uniqueid__c > i AND uniqueid__c < i+5000)
Hope this helps
AM
All Answers
This can be done easily if the formatting of the autonumber field is only numeric. Otherwise you might have to parse the string or use some sort of sortible interface to achieve what you want.
Hope this helps!
AM
And it gives me ... expecting a colon, found 'i'
and it gives me ... unexpected token: 'uniqueid__c'
I used ... (Integer.valueOf(uniqueid__c) > :i AND Integer.valueOf(uniqueid__c) < :i+5000)
And the result is
Invalid aggregate function: Integer.valueOf
Hope this helps
AM