Q:

count the day between two dates without duplication

I have following table 
  id      date  
------- + ---------      
  1      10-01-2014  
  2      10-01-2014  
  3      15-01-2014  
  4      15-01-2014  
  5      20-01-2014  
  6      30-01-2014  
  7      03-02-2014  
  8      12-02-2014  
  9      12-02-2014 
  10     19-02-2014  
  11     19-02-2014  

My table name is : attendance . I want to calculate the number of dates in Between 01-01-2014 to 20-02-2014 without repetiton.
Following is my query for this : 
SELECT distinct(todaydate) FROM attendance WHERE  todaydate between '01-02-2014' and '24-02-2014'

its working but the answer is wrong. 
Any solution.
Thanks in advance.

A:

Try this
SELECT DISTINCT(`date`) AS date
FROM attendance
WHERE UNIX_TIMESTAMP(`date`)>UNIX_TIMESTAMP('01-01-2014') 
      AND
      UNIX_TIMESTAMP(`date`)<UNIX_TIMESTAMP('24-02-2014')  

OR 
SELECT date
FROM attendance
WHERE UNIX_TIMESTAMP(`date`)>UNIX_TIMESTAMP('01-01-2014') 
      AND
      UNIX_TIMESTAMP(`date`)<UNIX_TIMESTAMP('24-02-2014')  
GROUP BY date

