windows date

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • B. Verkerk

    windows date

    How can I convert a windows date stored in Mysql (ie 38397 for today) to something I can use in a where clause?

    Thnaks,

    Bart


  • Bill Karwin

    #2
    Re: windows date

    B. Verkerk wrote:[color=blue]
    > How can I convert a windows date stored in Mysql (ie 38397 for today) to something I can use in a where clause?[/color]

    Here's an expression that converts the value 38397 to '2005-02-14'.
    Does this do what you want?

    mysql> SELECT FROM_DAYS( 38397 + TO_DAYS('1899-12-30') );
    +--------------------------------------------+
    | FROM_DAYS( 38397 + TO_DAYS('1899-12-30') ) |
    +--------------------------------------------+
    | 2005-02-14 |
    +--------------------------------------------+
    1 row in set (0.00 sec)

    Regards,
    Bill K.

    Comment

    • B. Verkerk

      #3
      Re: windows date

      thanks!

      "Bill Karwin" <bill@karwin.co m> schreef in bericht news:curbme01qq a@enews4.newsgu y.com...[color=blue]
      > B. Verkerk wrote:[color=green]
      > > How can I convert a windows date stored in Mysql (ie 38397 for today) to something I can use in a where clause?[/color]
      >
      > Here's an expression that converts the value 38397 to '2005-02-14'.
      > Does this do what you want?
      >
      > mysql> SELECT FROM_DAYS( 38397 + TO_DAYS('1899-12-30') );
      > +--------------------------------------------+
      > | FROM_DAYS( 38397 + TO_DAYS('1899-12-30') ) |
      > +--------------------------------------------+
      > | 2005-02-14 |
      > +--------------------------------------------+
      > 1 row in set (0.00 sec)
      >
      > Regards,
      > Bill K.[/color]


      Comment

      Working...