By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,574 Members | 1,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,574 IT Pros & Developers. It's quick & easy.

Date/Time Problem with SQL

P: 6
Hi there,

I have a web app that works with SQL 2008 in ASP, vbscript code. A very simple thing; i have Projects page. There i have the Project Name, Company, and the Finish Date. I simply enter the value 22/11/2010 for example. When i hit the Save button, it works fine, i see in the SQL studio that the data is corretly saved. But when i enter 10/11/2010 for example, it swithces the day and month numbers as long as i hit the save button, as if it can not recognize which one is the month, which one is the day.
10/11/2010
11/10/2010
10/11/2010
...
...
This continues as long as i click the save/update button. It also changes in the SQL data itself.

how can i solve that problem?

Thanks in advance...
Feb 4 '10 #1

✓ answered by kabilahan

hi..

convert the date and store it...

example

just run this
select convert(varchar(10),getdate(),106)

output
10 Feb 201

Share this Question
Share on Google+
4 Replies


ck9663
Expert 2.5K+
P: 2,878
It has something to do with the server date format setting. Here, read this.

Good Luck!!!

~~ CK
Feb 4 '10 #2

P: 6
well thanks for the reply, seems to be a solution for me...will try tomorrow at work.

thanx
Feb 4 '10 #3

P: 14
hi..

convert the date and store it...

example

just run this
select convert(varchar(10),getdate(),106)

output
10 Feb 201
Feb 10 '10 #4

P: 6
Thanks for the trick kabilahan! i used it in my View, worked awesome ;)

thanks for the replies..
Feb 10 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.