0

Ok, i've got a table of data and i need to grab all records created in this month by the date field which has date in this format "2013-09-26".

So, in my where clause i'm trying the following:

DATE(unix_timestamp(orders.date_issued)) = 'between CURDATE() and CURDATE() - INTERVAL 1 MONTH'

So this isn't working, i'm assuming it's the date conversion i'm trying here? I've tried some different variants on the date conversion but nothing seems to work.

Any help would be really gratefully received!

bjohnb
  • 500
  • 2
  • 8
  • 20
  • A similar question has already been asked before, see link: http://stackoverflow.com/questions/11808232/how-do-i-get-the-first-day-of-the-current-month – Radhi Sep 30 '13 at 11:01

1 Answers1

2

This where condition will give you the records created in current month

WHERE MONTH(orders.date_issued) = MONTH(current_date())

Deepak Rai
  • 2,163
  • 3
  • 21
  • 36
  • 1
    This does it though - MONTH(orders.date_issued) = MONTH(current_date()) AND YEAR(orders.date_issued) = YEAR(current_date()) - thanks a million for the help! – bjohnb Sep 30 '13 at 11:13