Link to home
Start Free TrialLog in
Avatar of greenbug2002
greenbug2002

asked on

MySQL Select Distinct

hi i wish to select distinct from a colum that has data like this:2006-08-29 11:22:08 but i only want to select distinct on the date part not the time aswell please show me how to atchive this thanks
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

use date_format() function to format the output to the date part only
http://dev.mysql.com/doc/mysql/en/date-and-time-functions.html
Avatar of greenbug2002
greenbug2002

ASKER

hi thanks for thereply
i have looked at your url however the things its discussing there are way above my ability to understand i curently have
select distinct `date_purchased` from orders WHERE `bookedby` = 'Internet Order' order by `date_purchased`

the date purchased colum has data like: 2006-08-29 11:22:08 im guessing a trim or soumthing like that needs to be done first?
can you give me an example?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thans verry mutch i see what the url was going on about now