Hello,
Tim Carlson wrote:

>Hello,
>
>Newbie SQL person here. I am hoping to be able to do the
>following. Given two dates, I would like to display all of the days
>between them.
>
>So if I had the dates 2002-02-08 and 2002-02-12, I would like to have
>MySQL spit back
>
>2002-02-08
>2002-02-09
>2002-02-10
>2002-02-11
>2002-02-12
>
>Any way I can do this directly in MySQL without constructing a table? I've
>looked through the date maniplulation routines in the manual, but nothing
>jumps out at me. Any pointers would be appreciated.
>
Suppose you have some table with column called date_col DATE. i.e. containing dates as 
above
Now if your question is:
How to select all rows where is true that date_col is between dates 2002-02-08 and 
2002-02-12?

You can use almost same spelling. (SQL is written to be close to natural english)

mysql> SELECT date_col FROM your_table WHERE date_col BETWEEN '2002-02-08' AND 
'2002-02-12';

will be valid statement :)

-- 
Best regards
-- 
For technical support contracts, visit https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Alexander Keremidarski <[EMAIL PROTECTED]> 
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Sofia, Bulgaria
       <___/   www.mysql.com   M: +359 88 231668





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to