Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am thybag on github.
* I am thybag (https://keybase.io/thybag) on keybase.
* I have a public key whose fingerprint is 37B8 D8FD E5F3 46E9 DA35 3959 1778 6B9F F6A2 0A2B
To claim this, I am signing this object:
@thybag
thybag / uk-tax-year-mysql.md
Created November 7, 2017 12:14
Get UK tax year from a date column in MYSQL

Its not pretty but it works

Stand alone

(date time being '2017-04-06')

SELECT CONCAT(year('2017-04-06' + INTERVAL -3 MONTH + INTERVAL -5 DAY),'-',YEAR('2017-04-06' + INTERVAL -3 MONTH + INTERVAL -5 DAY)+1) as tax_year

As a function