I am using that.. but also with distinct.. and MIN or MAX.. not sure if I completely understand DISTINCT or not..
heres an example.. I want or group by manufacturer... and have the most current date shown
but distinct by dates.. which the dates come in from a csv file as text.. then converted how I show it below.. it does convert and the column is entrydate, which is set in sql to DATE
$sql = "INSERT INTO TMP SELECT DISTINCT Bike_manufacture, MAX(STR_TO_DATE(entrydate, '%m/%d/%Y')) as entrydate, blah, blah_blah, bleh_bleh_bleh from STREETB group by (Bike_manufacture)";
mysql_query($sql);
it converts the date coming in as 08/08/2008 to 2008-08-08 fine..
But the MIN or MAX is only grabbing the lower of the two Bike_manufacture's that are the same cept for the changes in the newer entry...
like yamaha 2008-08-08
and yamaha 2008-10-10
it grabs 2008-08-08 everytime..
is it cause sql is not converting the date properly into the Table so sql is grabbing the older one all the time?
MAX(STR_TO_DATE(entrydate, '%m/%d/%Y'))
cant the above be used on the fly when transfering into the TMP table?
to anyone who can help.. its now a 3 week trial and error tedious process.
thanks to anyone who can suggest anything to move me on from being stuck this long lol.