Monday, February 20, 2012

Problem with dates format passed as parameters...

Hi,

I am having the "classical problem" of the forums; A local date changed to the american format (normally in the development environment) which I call "Switching months with days"... well it switches both again if you press "view report" again :)

The problem I'm having is that when I Navigate from one report to other, the dates get switched...
Everything's been set in the locale uk date format (dd/mm/aaaa), in the operating system, in the database and in the reports... and the reports are working properly through the web interface.. the only thing that is not working properly is the Navigation which switches the date month with the day...

Changing all the Reporting Services server, database server to the american format date is not an acceptable solution.

Thanks for any guidance on this, as I'm pretty lost...
Jose

where are you switching the dates.

may be create and set a workflag and set it to 0 or 1

based if its 1 dont do anything if its 0 switch the dates to american format. so even if the user clicks the view report again, it will check for 1 and does nothing.

Thanks

Kishore.

|||Hi Raja,

Thanks for your help, I'll try to explain what you ask:
I have a report with two parameters :
BeginningDate|||Try using string instead of datetime parameter, formatted as yyyyMMdd.

This is something like Convert(varchar(8),mydate,112)

Here is a good link with examples in SQL.
http://databases.aspfaq.com/database/what-are-the-valid-styles-for-converting-datetime-to-string.html

In Reporting Services you would use the Format function. eg. Format(MyDate, "yyyyMMdd")

cheers,
Andrew|||Hi!

That would work if the report wasn't called directly from the user, then, with that approach we are unable to present him the data selector, so he will have to write down the date this way... that is not acceptable by my client...

If the report was accessible only through the Navigation Link your approach would work wonderfully...

The point is how to make dates work right in other languages in SQL Server 2005 Reporting Services.... we are at the 2nd Service pack and it still doesn't work properly.. sigh...

Have to say that I have tried everything here, changing the user that executes the reporting services service, the database language, the system locale, the web.config locale, the report, table and all is set to spain (spain) and still it twists the date when we pass it as a paremeter

"13/02/2006" to "02/13/2006" , giving the properly errors, though...

Well, any help on this?
Thanks!!!
Jose

No comments:

Post a Comment