February 11, 2009 at 7:36 am
Dear Friends:
I have a task on SQL Server 2005 that need to get relative Date format for choosing Language in Regional and Language Option on Control panel.
Ex : Default Language setting is "English (United States").
So that SQL Query to Get Date has to show " 2/11/2009".
Similarly if I select English(United Kingdom) in Regional and Language Option on Control panel.
then SQL Query to Get Date has to show the Date format as "11/02/2009".
Can any one help on this regard.
Thanks
February 11, 2009 at 8:24 am
If you use ISO format yyyymmdd in your queries then it will work with all language settings.
Check this out:
SET LANGUAGE us_english
SELECT
ISDATE('20091231'),
ISDATE('12/31/2009'),
ISDATE('31/12/2009')
SET LANGUAGE british
SELECT
ISDATE('20091231'),
ISDATE('12/31/2009'),
ISDATE('31/12/2009')
SET LANGUAGE ceština
SELECT
ISDATE('20091231'),
ISDATE('12/31/2009'),
ISDATE('31/12/2009')
SET LANGUAGE Svenska
SELECT
ISDATE('20091231'),
ISDATE('12/31/2009'),
ISDATE('31/12/2009')
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply