SELECT DATE_FORMAT( payment_dt, '%Y-%M-%d' ) AS DATE,
CASE WHEN quarter(payment_dt)=1
THEN CONCAT(YEAR(payment_dt)-1, '-Q',QUARTER(payment_dt)+3)
ELSE concat(YEAR(payment_dt),'-Q',QUARTER(payment_dt)-1)
END AS qt_year
FROM `plus2_bills`
October to September Financial Year
DATE
qt_year
2015-March-04
2014-Q2
2015-March-09
2014-Q2
2015-April-11
2014-Q3
2015-April-24
2014-Q3
2015-September-10
2014-Q4
2015-September-14
2014-Q4
2015-October-09
2015-Q1
2015-October-16
2015-Q1
2016-February-11
2015-Q2
2016-February-18
2015-Q2
2016-June-09
2015-Q3
2016-June-24
2015-Q3
2016-July-14
2015-Q4
2016-July-27
2015-Q4
2016-October-13
2016-Q1
2016-October-21
2016-Q1
2017-January-03
2016-Q2
2017-January-12
2016-Q2
2017-May-10
2016-Q3
2017-May-19
2016-Q3
2017-August-17
2016-Q4
2017-August-29
2016-Q4
2017-December-07
2017-Q1
2017-December-22
2017-Q1
2018-March-02
2017-Q2
2018-March-12
2017-Q2
SELECT DATE_FORMAT( payment_dt, '%Y-%M-%d' ) AS DATE,
CASE WHEN QUARTER( payment_dt ) !=4
THEN CONCAT( YEAR( payment_dt ) -1, '-Q', QUARTER( payment_dt ) +1 )
ELSE CONCAT( YEAR( payment_dt ) , '-Q', QUARTER( payment_dt )-3 )
END AS qt_year
FROM `plus2_bills`
We can change the display format of the Financial Year
April to March as financial Year
DATE
qt_year
2015-March-04
2014-15 - Q4
2015-March-09
2014-15 - Q4
2015-April-11
2015-16 - Q1
2015-April-24
2015-16 - Q1
2015-September-10
2015-16 - Q2
2015-September-14
2015-16 - Q2
2015-October-09
2015-16 - Q3
2015-October-16
2015-16 - Q3
2016-February-11
2015-16 - Q4
2016-February-18
2015-16 - Q4
2016-June-09
2016-17 - Q1
2016-June-24
2016-17 - Q1
2016-July-14
2016-17 - Q2
2016-July-27
2016-17 - Q2
2016-October-13
2016-17 - Q3
2016-October-21
2016-17 - Q3
2017-January-03
2016-17 - Q4
2017-January-12
2016-17 - Q4
2017-May-10
2017-18 - Q1
2017-May-19
2017-18 - Q1
2017-August-17
2017-18 - Q2
2017-August-29
2017-18 - Q2
2017-December-07
2017-18 - Q3
2017-December-22
2017-18 - Q3
2018-March-02
2017-18 - Q4
2018-March-12
2017-18 - Q4
SELECT DATE_FORMAT( payment_dt, '%Y-%M-%d' ) AS DATE,
CASE WHEN quarter(payment_dt)=1
THEN CONCAT(YEAR(payment_dt)-1, '-',date_format(payment_dt,'%y'), ' - Q',QUARTER(payment_dt)+3)
ELSE concat(YEAR(payment_dt),'-',date_format(payment_dt,'%y') +1,' - Q',QUARTER(payment_dt)-1) END AS qt_year FROM `plus2_bills`
October to September Financial Year
DATE
qt_year
2015-March-04
2014-15 - Q2
2015-March-09
2014-15 - Q2
2015-April-11
2014-15 - Q3
2015-April-24
2014-15 - Q3
2015-September-10
2014-15 - Q4
2015-September-14
2014-15 - Q4
2015-October-09
2015-16 - Q1
2015-October-16
2015-16 - Q1
2016-February-11
2015-16 - Q2
2016-February-18
2015-16 - Q2
2016-June-09
2015-16 - Q3
2016-June-24
2015-16 - Q3
2016-July-14
2015-16 - Q4
2016-July-27
2015-16 - Q4
2016-October-13
2016-17 - Q1
2016-October-21
2016-17 - Q1
2017-January-03
2016-17 - Q2
2017-January-12
2016-17 - Q2
2017-May-10
2016-17 - Q3
2017-May-19
2016-17 - Q3
2017-August-17
2016-17 - Q4
2017-August-29
2016-17 - Q4
2017-December-07
2017-18 - Q1
2017-December-22
2017-18 - Q1
2018-March-02
2017-18 - Q2
2018-March-12
2017-18 - Q2
SELECT DATE_FORMAT( payment_dt, '%Y-%M-%d' ) AS DATE,
CASE WHEN quarter(payment_dt)!=4
THEN CONCAT(YEAR(payment_dt)-1, '-',date_format(payment_dt,'%y'), ' - Q',QUARTER(payment_dt)+1)
ELSE concat(YEAR(payment_dt),'-',date_format(payment_dt,'%y')+1,' - Q',QUARTER(payment_dt)-3) END AS qt_year FROM `plus2_bills`