In fidWorthWITH first_last_records AS( SELECT fidCurDate, fidWorth, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate ASC ) AS rn_asc, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate DESC ) AS rn_desc FROM fidelity WHERE YEAR(fidCurDate) = YEAR(CURDATE())) SELECT DATE_FORMAT( first_record.fidCurDate, '%Y-%m-%d (%W)') AS `First Date and Day`, CONCAT( '$ ', FORMAT(first_record.fidWorth, 2)) AS 'First fidWorth', DATE_FORMAT( last_record.fidCurDate, '%Y-%m-%d (%W)') AS `Last Date and Day`, CONCAT( '$ ', FORMAT(last_record.fidWorth, 2)) AS 'Last Worth of Year', CONCAT( '$ ', FORMAT( last_record.fidWorth - first_record.fidWorth, 2)) AS 'Difference', CONCAT( FORMAT( ( ( last_record.fidWorth - first_record.fidWorth ) / first_record.fidWorth) * 100, 2), '%') AS 'Percentage Gain' FROM first_last_records first_record JOIN first_last_records last_record ON first_record.rn_asc = 1 AND last_record.rn_desc LIMIT 1;In fidTotWITH first_last_records AS( SELECT fidCurDate, fidTot, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate ASC ) AS rn_asc, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate DESC ) AS rn_desc FROM fidelity WHERE YEAR(fidCurDate) = YEAR(CURDATE())) SELECT DATE_FORMAT( first_record.fidCurDate, '%Y-%m-%d (%W)') AS `First Date and Day`, CONCAT( '$ ', FORMAT(first_record.fidTot, 2)) AS 'First fidTot', DATE_FORMAT( last_record.fidCurDate, '%Y-%m-%d (%W)') AS `Last Date and Day`, CONCAT( '$ ', FORMAT(last_record.fidTot, 2)) AS 'Last Worth of Year', CONCAT( '$ ', FORMAT( last_record.fidTot - first_record.fidTot, 2)) AS 'Difference', CONCAT( FORMAT( ( ( last_record.fidTot - first_record.fidTot ) / first_record.fidTot) * 100, 2), '%') AS 'Percentage Gain' FROM first_last_records first_record JOIN first_last_records last_record ON first_record.rn_asc = 1 AND last_record.rn_desc LIMIT 1;In mTotWITH first_last_records AS( SELECT fidCurDate, mTot, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate ASC ) AS rn_asc, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate DESC ) AS rn_desc FROM fidelity WHERE YEAR(fidCurDate) = YEAR(CURDATE())) SELECT DATE_FORMAT( first_record.fidCurDate, '%Y-%m-%d (%W)') AS `First Date and Day`, CONCAT( '$ ', FORMAT(first_record.mTot, 2)) AS 'First mTot', DATE_FORMAT( last_record.fidCurDate, '%Y-%m-%d (%W)') AS `Last Date and Day`, CONCAT( '$ ', FORMAT(last_record.mTot, 2)) AS 'Last Worth of Year', CONCAT( '$ ', FORMAT( last_record.mTot - first_record.mTot, 2)) AS 'Difference', CONCAT( FORMAT( ( ( last_record.mTot - first_record.mTot ) / first_record.mTot) * 100, 2), '%') AS 'Percentage Gain' FROM first_last_records first_record JOIN first_last_records last_record ON first_record.rn_asc = 1 AND last_record.rn_desc LIMIT 1;In nTotWITH first_last_records AS( SELECT fidCurDate, nTot, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate ASC ) AS rn_asc, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate DESC ) AS rn_desc FROM fidelity WHERE YEAR(fidCurDate) = YEAR(CURDATE())) SELECT DATE_FORMAT( first_record.fidCurDate, '%Y-%m-%d (%W)') AS `First Date and Day`, CONCAT( '$ ', FORMAT(first_record.nTot, 2)) AS 'First nTot', DATE_FORMAT( last_record.fidCurDate, '%Y-%m-%d (%W)') AS `Last Date and Day`, CONCAT( '$ ', FORMAT(last_record.nTot, 2)) AS 'Last Worth of Year', CONCAT( '$ ', FORMAT( last_record.nTot - first_record.nTot, 2)) AS 'Difference', CONCAT( FORMAT( ( ( last_record.nTot - first_record.nTot ) / first_record.nTot) * 100, 2), '%') AS 'Percentage Gain' FROM first_last_records first_record JOIN first_last_records last_record ON first_record.rn_asc = 1 AND last_record.rn_desc LIMIT 1;In oTotWITH first_last_records AS( SELECT fidCurDate, oTot, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate ASC ) AS rn_asc, ROW_NUMBER() OVER( PARTITION BY YEAR(fidCurDate) ORDER BY fidCurDate DESC ) AS rn_desc FROM fidelity WHERE YEAR(fidCurDate) = YEAR(CURDATE())) SELECT DATE_FORMAT( first_record.fidCurDate, '%Y-%m-%d (%W)') AS `First Date and Day`, CONCAT( '$ ', FORMAT(first_record.oTot, 2)) AS 'First oTot', DATE_FORMAT( last_record.fidCurDate, '%Y-%m-%d (%W)') AS `Last Date and Day`, CONCAT( '$ ', FORMAT(last_record.oTot, 2)) AS 'Last Worth of Year', CONCAT( '$ ', FORMAT( last_record.oTot - first_record.oTot, 2)) AS 'Difference', CONCAT( FORMAT( ( ( last_record.oTot - first_record.oTot ) / first_record.oTot) * 100, 2), '%') AS 'Percentage Gain' FROM first_last_records first_record JOIN first_last_records last_record ON first_record.rn_asc = 1 AND last_record.rn_desc LIMIT 1;