Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Exclude fields from a report using RIGHT() command

$
0
0

Hello,

I have an audit table that I am running queries against to ensure there is not data loss.  All changes in our database get logged in this audit table.  For the purposes of my query I am trying to exclude any column that ends in "_F".

I know I'm close, I'm just missing something that is staring me in the face.

SELECT * 
From Audit
WHERE OldValue IS NOT NULL and NewValue IS NULL and RIGHT((SELECT ColumnName FROM Audit WHERE ColumnName <> '_F'),2)

 I'm getting errors at the SELECT statement after the RIGHT and the comma that follows.

As always, any help is greatly appreciated,

David92595


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>