开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜