Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 i need where condition

Author  Topic 

krish001
Yak Posting Veteran

61 Posts

Posted - 2009-10-12 : 06:41:50
Iam having a query where i need people availability.....in a project


select people from table where projectstratdate >=fromdate and

projectfinishdate <= todate iam using this query, from and to dates are parameters which user enters it is working but my problem
fromdate and Todate are same i need availability of people.....

plz let me know which condition can i use????
urgent

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-10-12 : 06:45:53
Hi, Try this once

select people from table where CONVERT(VARCHAR(32),projectstratdate,101) >= @fromdate and CONVERT(VARCHAR(32),projectfinishdate,101) <= @todate
Go to Top of Page

krish001
Yak Posting Veteran

61 Posts

Posted - 2009-10-12 : 07:09:19
quote:
Originally posted by Nageswar9

Hi, Try this once

select people from table where CONVERT(VARCHAR(32),projectstratdate,101) >= @fromdate and CONVERT(VARCHAR(32),projectfinishdate,101) <= @todate



This is the query iam using.....

select distinct(ResourceName)
from MSP_EPMPROJECT_USERVIEW P,MSP_EPMRESOURCE_USERVIEW R, MSP_EPMASSIGNMENT_USERVIEW A
WHERE P.PROJECTUID= A.PROJECTUID AND A.RESOURCEUID= R.RESOURCEUID
AND AssignmentStartDate between @FromDate and @ToDate and AssignmentFinishDate between @FromDate and @ToDate

Example when assignment is between 01-01-2009 to 05-05-2009
between this period resource name will not show this is working for me....but when i give from as '01-01-2009 'and todate as '01-01-2009 ' still resource must not come......but iam getting resource.
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-10-12 : 07:17:02
select distinct(ResourceName)
from MSP_EPMPROJECT_USERVIEW P,MSP_EPMRESOURCE_USERVIEW R, MSP_EPMASSIGNMENT_USERVIEW A
WHERE P.PROJECTUID= A.PROJECTUID AND A.RESOURCEUID= R.RESOURCEUID
AND @FromDate between AssignmentStartDate and AssignmentFinishDate
@ToDate between AssignmentStartDate and AssignmentFinishDate
Go to Top of Page

krish001
Yak Posting Veteran

61 Posts

Posted - 2009-10-12 : 07:27:38
quote:
Originally posted by bklr

select distinct(ResourceName)
from MSP_EPMPROJECT_USERVIEW P,MSP_EPMRESOURCE_USERVIEW R, MSP_EPMASSIGNMENT_USERVIEW A
WHERE P.PROJECTUID= A.PROJECTUID AND A.RESOURCEUID= R.RESOURCEUID
AND @FromDate between AssignmentStartDate and AssignmentFinishDate
@ToDate between AssignmentStartDate and AssignmentFinishDate



still it is not workingg plz give sln
Go to Top of Page
   

- Advertisement -