I have two date columns in my table. Start date and End date i want to compare between these two columns and only those records should be returned whose difference is 90 days. Any help?
Answer by sp_lock ·
More infor @ link
SELECT Col1, Col2, FROM Tab1 WHERE DATEDIFF(d, date1,date2) = 90
This datediff function allows you do supply 2 dates (date1 and date2) and a workout the difference using a datepart (d in this case), others can be found in the above link.