I am new to SQL statements and I am having a little trouble getting data from a week ago based on the date modified.
SELECT People.first, People.last, company.companyname, People.lastmodified
FROM job_prof
INNER JOIN People ON job_prof.cid = People.cid
INNER JOIN company ON job_prof.Id = company.id
-> WHERE People.lastmodified = DATE(DATE_ADD(GETDATE(), INTERVAL -7 DAY))
ORDER BY People.lastmodified DESC";
Example of Date in the table is 6/9/2011 12:08:01 PM
Any suggestions will be helpful.
Thank you
1 Answer