SELECT *
FROM tbl1
WHERE EXISTS (SELECT 1
FROM tbl2
WHERE tbl2.id2 = tbl1.id)
OR EXISTS (SELECT 1
FROM tbl3
WHERE tbl3.id2 = tbl1.id
AND EXISTS (SELECT 1
FROM tbl4...
I'm curious now.
I created a table and populated it with the sample data you provided. When I run your query I don't get any results returned because the dates generated by the dateadd function are from august & september 2004.
This is what I did
>>>>>>>>>>>>>>>>>>>>
create table...
I don't understand exactly what you are trying to do with this SQL statement but I have noticed one thing.
The reference to createdate in the WHERE clause is incorrect. It should be referencing the actual column name in your view or table and not the column alias i.e. create_date instead of...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.