Day/Month/Year date changed to Month/Day/Year in SQL

Hi Experts
i have an old Classic ASP application that have a form to add record with Day/Month/Year format, when the date entered as 23/06/2015 in SQL will be added correctly as 23/06/2015 but when date entered as 01/06/2015 : 1st june 2015 in SQL will be added as 06/01/2015 which will be incorrect
i searched the net for the solution for that and found this article
INF: How to Set the Day/Month/Year Date Format in SQL Server

but when i tried to run this query to configure the database
exec sp_addlanguage 'British', 'English',
   'January,February,March,April,May,June,July,August,September,October,
   November,December',
      'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec',
   'Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday',
   dmy,1
   sp_configure 'default language', 1
   reconfigure with override

Open in new window


i am getting an error message:
Msg 102, Level 15, State 1, Line 11
Incorrect syntax near 'sp_configure'.

can you please help me in solving this issue
thank you
LVL 1
AZZA-KHAMEESAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
I guess most likely the things need to be amended is within your ASP code instead.

In your ASP code, try to format your "date" into "mm/dd/yyyy" instead, or use an implicit format like "dd mmm yyyy". That will ensure the date that saved into database is in the correct value.

post your ASP code that saved the record if necessary.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
and I doubt it's necessary for you need to do the configuration as posted in your question above.
HuaMin ChenProblem resolverCommented:
You can directly use Dateadd to adjust the date like
SELECT DATEADD(month, 1, '2006-08-30');
SELECT DATEADD(month, 1, '2006-08-31');

Open in new window

AZZA-KHAMEESAuthor Commented:
Thank you for the reply, yes i modified my code, and it worked :) thank you again
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.