lapucca
asked on
How to exclue numeric data from the select?
There are some errornous data entered in form of 4-digit year. How can I exclude inserting these? Thanks.
INSERT INTO [DegreeMajor]
([Major Title])
select distinct ltrim(rtrim(degree_Major)) from dbo.PersonDegree pd
where degree_Major is not null and degree_Major not in ('MD', 'Master', 'B.A.', 'M.D.', '.', '', 'Doctor', 'MSC')
INSERT INTO [DegreeMajor]
([Major Title])
select distinct ltrim(rtrim(degree_Major))
where degree_Major is not null and degree_Major not in ('MD', 'Master', 'B.A.', 'M.D.', '.', '', 'Doctor', 'MSC')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I don't want numeric value so should it be ISNUMERIC(degree_Major)=0? Thanks.
!= 1
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes if you are looking for values that are not numeric it should be
ISNUMERIC(degree_Major)=0
or
ISNUMERIC(degree_Major) <> 1
ISNUMERIC(degree_Major)=0
or
ISNUMERIC(degree_Major) <> 1
ASKER
Thank you.
from dbo.PersonDegree pd
where ISNUMERIC(degree_Major)=1
is enough...