List:General Discussion« Previous MessageNext Message »
From:Mike Blezien Date:April 1 2006 2:00pm
Subject:Re: Getting number days between 2 dates
View as plain text  
Jorrit,

----- Original Message ----- 
From: "Jorrit Kronjee" <j.kronjee@stripped>
To: <mysql@stripped>
Sent: Saturday, April 01, 2006 7:46 AM
Subject: Re: Getting number days between 2 dates


> Mike Blezien wrote:
>> Hello,
>>
>> I'm sure this is a simple query but haven't come up with a good approach. 
>> Need to get the number of days between two dates. IE: today's date: 
>> (2006-04-01 - 2006-03-05)
>> need to calculate the number of days between these dates.. what is the best 
>> query statement to accomplish this?
>>
>> TIA,

> Mike,
> You probably want to use something like this:
>
> SELECT TO_DAYS('2006-03-15') - TO_DAYS('2006-03-01');

Thanks, that works, also using the DAYOFYEAR produces the same results as I just 
found :)

appreciate the help

Mike

Thread
Getting number days between 2 datesMike Blezien1 Apr
  • Re: Getting number days between 2 datesJorrit Kronjee1 Apr
  • Re: Getting number days between 2 datesMike Blezien1 Apr
    • Re: Getting number days between 2 datesJorrit Kronjee1 Apr
  • Re: Getting number days between 2 datesRhino1 Apr
    • Re: Getting number days between 2 datesmysql1 Apr
  • Re: Getting number days between 2 datesMike Blezien1 Apr
    • RE: Getting number days between 2 datesJim MacDiarmid4 Feb
      • Re: Getting number days between 2 datesDuncan Hill5 Feb
        • RE: Getting number days between 2 datesJerry Schwartz5 Feb