Page 1 of 1

How can use Distinct query

Posted: Fri Jul 25, 2008 12:35 am
by vcodeinfotec
Hello,
I need your help to display the records from a table. In my table there is datetime field. I want to extract the records in a date (without time) from the list of records. I have used distinct query. but not works.

First i need to display the dates (without time) in a <select> tag. For example if there is 10 records in todays date and 5 records in yesterdays date. In these 15 records there is seperate time. But i need only 2 values only date without time (today's date & yesterday's). Can u help?

Please give advice.. Please help me..

Re: How can use Distinct query

Posted: Fri Jul 25, 2008 1:18 am
by Christopher
SELECT DISTINCT mydatefield FROM mytable;

Re: How can use Distinct query

Posted: Fri Jul 25, 2008 1:25 am
by vcodeinfotec
Hello,
I need only date value for 'distinct' not including the time..
2008-07-06 16:46:15
2008-07-06 16:47:44
2008-07-06 10:18:25
2008-07-24 14:38:25

If these are the records i need to get
2008-07-06
2008-07-24

Please help

Re: How can use Distinct query

Posted: Fri Jul 25, 2008 3:10 am
by Christopher

Re: How can use Distinct query

Posted: Sun Jul 27, 2008 11:28 pm
by vcodeinfotec
thanks..