|
-
Nov 6th, 2001, 04:04 PM
#1
Thread Starter
Addicted Member
Date
Hi,
In SQL Server is there a way to change the way to enter a date? The field is a datetime. I have to put dd/mm/yyyy otherwise it failed...but I prefer to have yyyy/mm/dd. What do I have to do if I want users to enter yyyy/mm/dd?
Thanks
Ça l'air que baiser enlève les maux de tête! Baisons!
On se mets-tu tout nu?
-
Nov 6th, 2001, 05:27 PM
#2
Lively Member
SQL Server should be able to accept any date format that it can recognize as a valid date. I know that yyyy-mm-dd works, in fact I think that is how SQL Server actually stores it. Well technically, it stores it as integers, but that's how Query analyzer will show it to you. Enterprise Manager uses your system settings.
The point is it shouldn't be failing if you are using something other than dd/mm/yyyy. That is definately not the only valid format.
If you can't get it to work though, you always have the option in VB of reformatting the date before passing it to SQL Server. Look up "User-Defined Date/Time Formats (Format Function)" in VB help. It explains the options for the Format Function which will allow you to reformat the user's input.
--KSW
-
Nov 6th, 2001, 05:51 PM
#3
Frenzied Member
I think that you can choose the date format in the field properties of the table.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Nov 6th, 2001, 07:48 PM
#4
Thread Starter
Addicted Member
Ok, but I can't believe there is no way to do this in Enterprise Manager!!
I'll use the formatdatetime,
thanks
Ça l'air que baiser enlève les maux de tête! Baisons!
On se mets-tu tout nu?
-
Nov 7th, 2001, 09:27 AM
#5
Frenzied Member
I am sure that you can do it from Enterprise Manager. Unfortunately I don't have DBA or DBO rights on our database so I couldn't tell you how you would go about doing it because I have never had a chance to play around with this stuff.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|