on 09-16-2008 9:17 AM
Hi
Do the standard comparison operators only work for numeric values?
I'm finding that
"a" < "b"
"a" > "b"
"a" == "b"
all return false.
"a" <= "b"
"a" >= "b"
both return true.
How do I properly compare "a" and "b"?
Thanks
Nick
Edited by: Nick Stannage on Sep 16, 2008 9:21 AM
Assuming you want to compare strings for equality/inequality, I would use the the match() function in the BL editor which would return a 0/1 as the case may be.
Is this what you are looking for?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nick,
Use the datecompare function, if you want to compare two dates.
datecompare(datetoxmlformat("2008-09-15","yyyy-MM-dd"),datetoxmlformat("2008-09-16","yyyy-MM-dd))
See the help for more info: http://help.sap.com/saphelp_xmii115/helpdata/en/Business_Logic_Services/expressions.htm
John
But unless you are looking for an equivalent ascii value for a string I do not see how you can get a greater or less than for a string.
If this is the case then I guess you would need a custom action because as far as I know no methods are available for these.
Otherwise what John's posted (for dates) should be the way to go.
For strings that are just numeric you can use the number() function followed by the different operators for comparison.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.