OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Date ranges without intervals...

From: David Brady (maxdbferriel.com)
Date: Tue Apr 06 2004 - 12:41:46 CDT


Thanks all for the suggestions. The help is certainly appreciated.
I've decided that the easiest thing to do is to run the query in Oracle
mode. It works, and is relatively simple versus other solutions.

One request - I'd be very nice if MaxDB supported intervals. It makes
writing queries that involve, um, intervals very easy.

Cheers,
David

Andris Spruds wrote:

>You could write a stored procedure, but it would be difficult to write one
>that takes care of long years.
>
>----- Original Message -----
>From: "David Brady" <maxdbferriel.com>
>To: "Andris Spruds" <litremaapollo.lv>
>Cc: <maxdblists.mysql.com>
>Sent: Monday, April 05, 2004 11:47 PM
>Subject: Re: Date ranges without intervals...
>
>
>Andris Spruds wrote:
>
>
>
>>The 2nd argument is time in days. Furthermore, you can construct the 2nd
>>date outside MaxDB.
>>
>>Example:
>>SELECT adddate('2003-12-01 00:00:00', 31) FROM DUAL
>>
>>
>>
>>
>Thanks...
>
>This won't work since months have different numbers of days. (And, I'd
>have to hack at a 3rd party reporting tool to construct the second date
>- I'm reluctant to go for that solution.) Is there any way to get the
>number of days for a month, given a year and a month?
>
>The best I can come up with is to use Oracle mode (I hate to do it
>though) and:
>
> post_date >= '2003-12-01 00:00:00' and post_date <
>add_months('2003-12-01 00:00:00', 1)
>
>I'd like to think there's a way of doing this without Oracle mode, though...
>
>
>
>
>

--
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb