you should look at the documentation for the database you are using.
in mysql one might do  "distinct month(Post.created) ...."  but
reading some documentation would really save yourself some ridicule in
the long run.  If you rely on this list as your crutch people are
going to start getting cranky.  This is really a question that can be
very database specific.

HTH,
   A old fart who is starting to get cranky

On 8/24/06, c_doug <[EMAIL PROTECTED]> wrote:
>
> I am trying to make a Archives (by month) section in a blog. How can I
> format a date for use in a query? Example so far:
>
> $cmonth = "date_format(Post.created, 'F')";
> $data = $Post->query('SELECT DISTINCT `' .$cmonth. '` FROM posts');
>
> I was trying to Select Distinct by Month but this only outputs $cmonth
> as a string. Is there an easier, better or more standard way?
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to