Calculating 7 days ahead of currentdate?
Posted on 2006-10-30
I am trying to create a query that will give me all the records that have a date equal to currentDate + 7, so all records that have a date between the current date and 1 week basically.
My sql seems to be a bit off here
SELECT m.*, c.fname + ' ' + c.lname as fullname, cat.category as categoryName
FROM table m
INNER JOIN categories cat ON cat.categoryId = m.categoryId
LEFT JOIN customer c ON c.customerId = m.customerId
WHERE DATEADD(d,7,CONVERT(datetime,CONVERT(varchar(15),GETDATE(),101))) >= myDateColumn
Any help appreciated. I am looking for all records that have a value in the 'myDateColumn' that is between the currentDate and 1 week. I am not interested in time at this point as we are only storing the date in the db.