Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dates and SQL Server

    I am trying to enter dates into a MSSQL server 2000 db. Everytime it updates it saves the value 1/1/1900. If I Response.Write my SQL it is showing the correct dates. For some reason when it is updating though it is changing it to 1/1/1900. I have tried just entering the date like txtdtExpires.Text and casting its type to a date CType(txtdtExpires.Text,Date) with no luck. Can anyone tell me why it enters 1/1/1900?

  • #2
    Regular Coder
    Join Date
    Dec 2002
    Location
    France
    Posts
    522
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cultures

    the best format for keeping dates is

    2003-01-14 = YYYY-MM-DD

    I think you are hosting your web site in another culture as yours,

    you must save the date in the universal format as above, and then display the result on your web page with the culture you like

    if you cannot do it, then just save your dates as string

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you post the SQL statement as it's written out?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Finally figure it out I did need to CType(var,Date) but I forgot to put the infamous ' ' around them.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •