Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Parameter List Formatting

Status
Not open for further replies.

seequal

Technical User
Sep 26, 2005
11
GB
Good morning,

I am trying to add a List of Dates to be used as Parameters in an SSRS 2005 Report. The reason for this is that the Report is quite resource heavy and I only want the end user to use a weeks worth of data only at any one time.

I created a dataset (script at end of post) and used that data set to populate my Report Parameters (Start Date and End Date). It works fine except for when I go and run the report, the Parameter List has been formatted into an American Date Format as opposed to British in the dataset. The report Language setting is "English (United Kingdom)".

Can anyone help ?
Thanks

DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME
DECLARE @Counter INT
DECLARE @DateList TABLE (StartDate DATETIME, EndDate DATETIME)

SET @StartDate = CONVERT(DATETIME, CONVERT(CHAR(10), GETDATE(), 103), 103)
SET @EndDate = DATEADD(ss, -1, CONVERT(DATETIME, CONVERT(CHAR(10), GETDATE() + 1, 103), 103))

SET @Counter= 1

WHILE @Counter < 8
BEGIN
INSERT @DateList(StartDate, EndDate) values(@StartDate, @EndDate )
SET @StartDate = DATEADD(DD, -1, @StartDate)
SET @EndDate = DATEADD(DD, -1, @EndDate)
SET @Counter = @Counter + 1
END

SELECT StartDate, EndDate FROM @DateList ORDER BY 1




 
i think that the problem should fix itself as soon as you deploy the report.

any attempt to work with dates on the developement platform almost always fail, I am still forced to test data by entering 1/1/2008 or 3/3/2008 so that when the month and day swap places(american format) it does not make any difference

-Mo

If you don't stand for something, you'll fall for anything
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top