Hi,

I don't know if I am giving you enough information to diagnose the 
problem,  but here goes. I am trying to sort some dates, but they seem 
to not be sorting correctly so, for example, February 23, 2006 comes 
before February 11, 2006. Here is the query:

-----------------------------------------------------------
SELECT i.itin_id, d.destination, i.nights, 
DATE_FORMAT(MIN(sailing_date), '%b %e, %Y') AS minsd

FROM itineraries AS i, destinations AS d, ships AS s, cruise_lines AS 
cl, sailings AS sa

WHERE i.destination = d.dest_id AND i.cline = cl.cline_id AND i.ship = 
s.ship_id AND i.itin_id = sa.itin_id

GROUP BY i.itin_id

ORDER BY destination, sailing_date
------------------------------------------------------------

The "MIN()" call is supposed to go through the dates associated with 
the "i.itin_id" (they are stored in a different table) and find the 
earliest date. I'm at a bit of a loss.

Does any one have any idea?

Thanks,

Mark



The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to