Posted by Jerry Gitomer on 01/21/06 06:09
Notgiven wrote:
> Say you have two dates, 2005-01-01 and 2005-01-24. I want to get a list or
> array or all the date between and including those two dates.
>
> I want to include this list in a query so I need it in a format like:
> '2005-01-01', '2005-01-02',...
>
> Any ideas? thanks
>
>
Since you are planning to use the dates in a query (assuming you meant
a database query) there is no need to get a list of the dates. Use the
BETWEEN operator in your WHERE clause. For example to select all of the
dates in January 2005 you can use the following in your queries WHERE
clause:
WHERE data_date BETWEEN '2005-01-01' AND '2005-01-31'
HTH
Jerry
Navigation:
[Reply to this message]
|