Thanks for the help twifosp.
SELECT * FROM MonthlyActuals RMA
WHERE CAST(STR(RMA.Year ,4,0) + '-' +
STR(RMA.Month,2,0) + '-01'
AS DATETIME) >= '01 Jun 2000'
AND CAST(STR(RMA.Year ,4,0) + '-' +...
There's about 2 pages of SQL that goes with this, but it is restricting the records returned in the recordset by using the NOT EXISTS, but maybe a LEFT JOIN on the main table (sorry not shown in the script) utilising a NULL value could be a more efficient way of restricting the recordset.
I'm working on a very large database, I have this piece of SQL in my script, but I've been informed that there is a more efficient way of doing this by using LEFT JOIN and checking for Null, but I'm not sure how to do this, any suggestions would be greatly appreciated.
...AND NOT EXISTS
(...
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.