-4

Given Date is 2015-08-10 but i need to get the August month report.Do not use(BETWEEN 2015-08-01 and 2015-08-31).Please advise me.

date qty

2015-08-10 10

2015-08-20 2
2015-08-21 12

2015-09-01 5

sarath jay
  • 21
  • 2
  • 7
  • Your question is unclear - are you asking 'how can I select everything for the current month?' – Paul Dixon Sep 01 '15 at 11:07
  • Could you please show some code ? Example datas ? Have you tried anything ? It's hard to understand what you exactly want here. –  Sep 01 '15 at 11:08
  • Hi, and welcome to stackoverflow, please visit the [how to ask a good question](http://stackoverflow.com/tour) – Naruto Sep 01 '15 at 11:13

1 Answers1

0
     Now we are use BETWEEN for getting august month report 1 to 31. 

       $var2=' 2015-08-10';
      $date2 = str_replace('/', '-', $var2);

       // First day of the month.
      $From=date('Y-m-01', strtotime($date2));

      // Last day of the month.
      $To=date('Y-m-t', strtotime($date2));
sarath jay
  • 21
  • 2
  • 7