Results 1 to 5 of 5

Thread: Date

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    Shannon, Quebec, Canada
    Posts
    251

    Question 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?

  2. #2
    Lively Member
    Join Date
    Nov 2001
    Posts
    89
    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

  3. #3
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    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!


  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    Shannon, Quebec, Canada
    Posts
    251
    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?

  5. #5
    Frenzied Member seoptimizer2001's Avatar
    Join Date
    Apr 2001
    Location
    Toledo, Ohio USA GMT -5
    Posts
    1,075
    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
  •  



Click Here to Expand Forum to Full Width