sql server - Return all records within given date -


question

how return records today until given number of days in future?

example in pseudo code

select every record table  plandate = today , next 14 days 

what have tried?

select * joblist  plandate >= getdate() +14  

you can use dateadd:

where  plandate >= cast(getdate() date) ,    plandate < dateadd(day,+15, cast(getdate() date)) 

note have date type if use @ least sql-server 2008.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -