• how to records month two time fatch sql query

    Answered

    how to records month two time fatch sql query

    Bronze Member Asked on June 1, 2017 in MYSQL.
    Add Comment
  • 1 Answer(s)
    Best answer
    
    SELECT
    
    CONCAT( DATE_FORMAT(date_duration, '%b %Y Day ' ),
    
    CASE WHEN DAYOFMONTH( date_duration ) < 16
    
    THEN '01-15'
    
    ELSE CONCAT( '16-', RIGHT( LAST_DAY( date_duration ), 2) )
    
    END ) AS CharMonth,
    
    item_id,order_id,mid
    
    FROM
    
    " . DB_PREFIX . "nv_pay_seller_payment WHERE payment_mode ='0' AND MID = '" . $this->db->escape($sellerid) . "'
    
    ORDER BY
    
    YEAR( date_duration ),
    
    MONTH( date_duration )
    
    LIMIT 1
    
    
    Bronze Member Answered on June 1, 2017.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.