Dates Concatination
Hi,
In my Database i am having ResourceName,AssignmentStartDate,AssignmentFinishDate,In My Senario Resouces are Assigned in
AssignedStartDate:- 1st Jan 2011 ,AssignmentFinishDate:-31st March 2011
But in Report How to combine this dates,i am using Chart Report,i wanted to show this dates in Category Fields,Dates must be shown 1st jan To 31 st March
Thank You
January 18th, 2011 4:50am
Probably best to create a field in your query which has a value 1st Jan 2011 - 31st March 2011 and use that field in your category.
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2011 9:55am
CREATE FUNCTION fn_dates(@from AS DATETIME, @to AS DATETIME)
RETURNS @Dates TABLE(dt DATETIME NOT NULL PRIMARY KEY)
AS
BEGIN
DECLARE @rc AS INT
SET @rc = 1
INSERT INTO @Dates VALUES(@from)
WHILE @from + @rc * 2 - 1 <= @to
BEGIN
INSERT INTO @Dates
SELECT dt + @rc FROM @Dates
SET @rc = @rc * 2
END
INSERT INTO @Dates
SELECT dt + @rc FROM @Dates
WHERE dt + @rc <= @to
RETURN
END
GO
SELECT dt FROM fn_dates('20100101', '20110331')Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
January 18th, 2011 10:00am