sql select statement today’s date - 20 days?
Hi,
I want to use the SELECT statement to get all my records from my table which is 20 days from the current date. I have been trying all ways but can’t get it.. help will be appreciated!
SELECT WEIGHT, TIME, USER_ID
FROM dbo.WeightTable
WHERE (USR_ID = ‘abc’) AND ….(what to put here)
i am using ms sql server management studio express.. 2005 version. thanks!
SELECT WEIGHT, TIME, USER_ID
FROM dbo.WeightTable
WHERE (USR_ID = ‘abc’)
AND time > dateadd(day, -20, getDate())