patelajk
asked on
Ignore Text in Column
Hi
I have the query below - How do i ignore any entries in the column where they are TEXT entries.
E.g in the column acc.account - it can have entries such as:
12345
test
345
qwe
I want the query to ignore any records which are not numeric. Any ideas?
Select
--CAST (acc.Account AS INT),
acc.TITLE,
RIGHT(acc.ACCOUNT,5)
From
BM10MACELV.dbo.Projects proj LEFT JOIN SQSDBA.v_Account acc ON proj.[project nr] = RIGHT(acc.ACCOUNT,5)
Where acc.Ledger = 'P_INTPROJECT'
Thanks again
I have the query below - How do i ignore any entries in the column where they are TEXT entries.
E.g in the column acc.account - it can have entries such as:
12345
test
345
qwe
I want the query to ignore any records which are not numeric. Any ideas?
Select
--CAST (acc.Account AS INT),
acc.TITLE,
RIGHT(acc.ACCOUNT,5)
From
BM10MACELV.dbo.Projects proj LEFT JOIN SQSDBA.v_Account acc ON proj.[project nr] = RIGHT(acc.ACCOUNT,5)
Where acc.Ledger = 'P_INTPROJECT'
Thanks again
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Where acc.Ledger = 'P_INTPROJECT' AND ISNUMERIC(acc.Account) = 1
SELECT blah blah blah
FROM blah
WHERE ISNUMERIC(acc.ACCOUNT)
FROM blah
WHERE ISNUMERIC(acc.ACCOUNT)