DECLARE @tbl table
(
ID int identity,
ProjName varchar(100)
)
INSERT into @tbl(ProjName)
SELECT * from dbo.SemisvToString(@IAAudioEyeProjectNames)
also
CREATE TABLE #AERTTV2TempReportTable
(
ProjectName varchar(200),
TaskName varchar(400), --'CHANGED THIS 200 to 400 '
HoursSpent decimal(18,2),
ExecutionDate varchar(20),
UserName varchar(200)
)
TRUNCATE TABLE #AERTTV2TempReportTable
INSERT INTO #AERTTV2TempReportTable(ProjectName, TaskName, HoursSpent, ExecutionDate, UserName)
SELECT ProjectName, TaskName, HoursSpent, CONVERT(VARCHAR(20),ExecutionDate,101) AS ExecutionDate, UserName
FROM AudioEyeReporting.dbo.TempReportTable
WHERE IsDeleted = 0 AND ExecutionDate BETWEEN @StartDate AND @EndDate
UNION ALL
SELECT ProjectName, TaskName, HoursSpent, CONVERT(VARCHAR(20),CONVERT(DATETIME,ExecutionDate),101) AS ExecutionDate, UserName
FROM TimeTrackerV2.dbo.TempReportTable
WHERE ProjectName IN (SELECT ProjName FROM @tbl) AND ExecutionDate BETWEEN @StartDate AND @EndDate
SELECT * FROM #AERTTV2TempReportTable
SELECT SUM(HoursSpent)
FROM #AERTTV2TempReportTable
DROP TABLE #AERTTV2TempReportTable
234 unique visitors
No comments:
Post a Comment