Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Omit Deleted Records from SQL-Select Query Results 1

Status
Not open for further replies.

AllanB1

Programmer
Dec 30, 2002
201
US
Hi.

Without PACKing the table, how would you exclude the deleted records from the query result?

...WHERE !DELETED() doesn't do it.

Thanks.

Al
 
SET DELETED ON.

That's the only reliable way, especially if the SQL queries more than one table. The SQL engine opens the tables with noonpredictable alias names while executing, therefore you also cannot work with DELETED('tablename').

Bye, Olaf.
 
Good catch Olaf. I thought SET DELETED was ON, but it wasn't.

Al
 
Well, okay. If you have data from deleted records in a query result, it's a sure sign DELETED is OFF.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top