how to find which task is atpresent going on based on the today date
I have a set of projectnames stored in the database
projectname - project1 with startdate and enddate
How to find which task is at present going on, based on today's date ( note : two projects may have same dates too). I need to take the project names which falls under today date from all the other projects.
select distinct ProjectName
from P开发者_JS百科rojectPlan
where UserName=@username
and month(StartTime)='2'
This shows me the tasks under 2nd month and not exact project which is at present date.
Any idea ???
select distinct ProjectName from ProjectPlan where
UserName=@username and
GETDATE() BETWEEN StartDate AND EndDate
This ignores the effect of time on EndDate though
精彩评论