Basically I would like a select statement that would function like this
SELECT *
FROM table
WHERE column IS NOT INT
Is there a condition like this or how do you check for non-integers in an nvarchar(10) column?
Basically I would like a select statement that would function like this
SELECT *
FROM table
WHERE column IS NOT INT
Is there a condition like this or how do you check for non-integers in an nvarchar(10) column?
3条答案
按热度按时间eoigrqb61#
In
SQL Server
you can do:rkue9o1l2#
You could also use
v8wbuo2f3#
This is so weird
SELECT * FROM TABLE WHERE Period_Year > 1900 AND Period_Month BETWEEN 1 AND 12
Fixed the problem.
the database has no value that are less or eqeul to 1900 and it has no months NOT BETWEEN 1 OR 12.
I also did a SELECT DISTINCT ISDATE(CONCAT( Period_Year,'/',Period_Month,'/', 1)) FROM TABLE
I GOT A TRUE i.e 1 BACK
NO FALSE i.e 0 WHERE RETURNED
only 1 row with 1 for true
Even when I do SELECT * FROM TABLE WHERE Period_Year > 1
this fixes the problem