Datediff problem with Dates Greater than 12/31/29

Results 1 to 4 of 4

Thread: Datediff problem with Dates Greater than 12/31/29

  1. #1
    Join Date
    Dec 1969

    Default Datediff problem with Dates Greater than 12/31/29

    I need to compare two dates to ensure one is not greater than the other. I am using VB Script and the Datediff function to accomplish this. Everything is working fine until I enter a date greater than 12/31/29. For some reason the datediff function assumes the year is 1929 not 2029 and returns a negative value. The funny thing is I can literally run this same code in VB or in a stored procedure and it works fine. Any thoughts on how to get around this? Thanks.

  2. #2
    Steve Cimino Guest

    Default Welcome to the Y2K

    fix. Hey, why not revisit the stockmarket crash???<BR><BR>Does the same results happen when you compare the 4 digit year? I wouldn&#039;t think so, but you should look at that route.

  3. #3
    Join Date
    Dec 1969

    Default Read the docs...that's the rules...

    The MS docs specify that there is a "cutoff" year when applying century logic. I believe it is one of the system configurable parameters, even.<BR><BR>So if you use "1/1/1" you get 2001. If you use "1/1/99" you get 1999. And where the break between 20xx and 19xx is up to your system configuration.<BR><BR>HOWEVER...<BR><BR>Why not fix this yourself? Don&#039;t *allow* two digit years.<BR><BR>

  4. #4
    Funny guy... Guest

    Default JOKE answer...

    &nbsp;<BR><BR>Maybe Bill G. figured he wasn&#039;t going to be around past that year and didn&#039;t have to worry about it! *lol*

Posting Permissions

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