|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 7:59 PM
Points: 1,491,
Visits: 3,010
|
|
| Went looking on the net and found an answer right here in SSC (of course!!). If you want to test for all digits, the expression NOT LIKE '%[^0-9]%' should do it. Do read the entire post from Jeff Moden about testing for numbers.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, February 15, 2013 12:39 AM
Points: 80,
Visits: 312
|
|
PATINDEX('%[^0-9]%', LHP_PARAM_RESULT_VALUE) = 0
I am just mentioned a name only.
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Friday, February 15, 2013 12:39 AM
Points: 80,
Visits: 312
|
|
| PATINDEX('%[^0-9]%', LHP_PARAM_RESULT_VALUE) = 0
|
|
|
|
|
UDP Broadcaster
      
Group: General Forum Members
Last Login: Monday, June 10, 2013 7:59 PM
Points: 1,491,
Visits: 3,010
|
|
raguyazhin (2/14/2013) PATINDEX('%[^0-9]%', LHP_PARAM_RESULT_VALUE) = 0 The key, then, is the Not-to-match operator, "^". Zero returned means PATINDEX() found no characters other than digits, 0-9. Got it! Thanks for the clarification.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, June 13, 2013 2:02 PM
Points: 198,
Visits: 656
|
|
In your query you are casting as decimal(18,2). Are your numbers always going to be whole numbers?
The following example
select PATINDEX('%[^0-9]%', '1234234.20') does not return zero.
|
|
|
|