I have this query running. For the most part it works ok, but there are a few records that have non-number parts to them and this causes issues down the line. I need to be able to select just the records that are integers.
select distinct SUBSTRING(PAPROJNUMBER, 1, 5) AS STUDY_NUMBER
FROM dbo.PA01201 AS PA01201_1
where PAPROJNUMBER>'0'
For example, a part of the result list looks like this:
68145
68146
68147
7762A
99999
LABOR
i want all of those except 7762A and LABOR. How can I modify the where clause to achieve that efficiently?
Adding ‘.0e0’ to the substring will insure that the ISNUMERIC only returns valid integers.