February 24, 2009 at 2:32 am
Hi,
I may be on the incorrect section on the forum so please forgive me, but I couldn't find a more appropriate one.
I am new to Visual Studio and I am trying to get a report where the user choose a Start Date and End Date, when running the query and enter the dates as prompt I don't have an issue, however when I go to the preview the dates revert to US format 'dd/mm/yy', this is what I have in my code:
HAVING (dbo.Dim_Time.SimpleDate >= CONVERT(DATETIME, @StartDate, 103)) AND (dbo.Dim_Time.SimpleDate <= CONVERT(DATETIME, @EndDate, 103))
In the preview pane and without using the Calendar, if I enter dd/mm/yy then the qry runs but the date is displayed as dd/mm/yy...
Any help is very much appreciated.
Many Thanks,
All help and Any help
February 24, 2009 at 5:15 am
Hi there not sure what you are trying to do are you using Reporting services. If so you can try something like this in the display field on the report
=Format(Parameters!StartDate.Value,"dd/MM/yyyy")
February 25, 2009 at 6:30 am
Apologies, if I not explain correctly the issue, which is:
I am using Visual Studio 2005, and I can buid the query, I set up the parameters Start Date and End Date as a Date_Time, so when I wnat to see the results in the preview pane for some reason the date changes to US Format, rsulting in errors on the results as an example, when I enter 03/02/09 no results are displayed as the date reverts to 02/03/09.
Hope I made this more clear.
Thanks for the help
All help and Any help
February 25, 2009 at 11:52 pm
Hi Vitor.
Try this on the server that you are calling.
SELECT name ,alias, [dateformat]
FROM syslanguages
WHERE langid =
(SELECT [value] FROM master..sysconfigures
WHERE comment = 'default language')
This will reture your current language settings that the database has been installed with. More the likely us-english or should I say Microsoft english.
Then run the following script
Use Master
GO
EXEC SP_CONFIGURE 'default language','23';
RECONFIGURE WITH OVERRIDE;
GO
The value 23 will set the server to British english with a date format 'dmy'. To get a full list of installed languages run the following script.
SELECT * FROM sys.syslanguages
Please let me know how it goes. I am fortunate that the all my servers are setup correctly and all call come from the same source so I don't have to worry about different date formats.
February 26, 2009 at 4:16 am
Thank You for the help, seems to work
All help and Any help
February 26, 2009 at 4:19 am
Good stuff. All the best
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply