I have this table in my Database and i hava a history with entrys:
Tabelname: Activity
ActivityID | DateBegin | DateEnd 1 2013-01-01 2013-01-15 1 2013-01-15 9999-12-31 2 2013-01-20 2013-03-15 Now i want to write a Query which will return the id with the DateEnd = 9999-12-31. In this example i want the return only id 2
I wrote this query, but it doesn't function: (I get a return statement of NULL)
SELECT ActivityID FROM [dbo].[Activity] where NOT EXISTS (SELECT ActivityID from Activity where DateEnd ='9999-12-31') Can somebody help me ?
Thanks a lot
NOT EXISTS?select * from table where dateend <> '9999-12-31'