Fix Proper date change ordinal to datetime

+ change sql statement for easier reading

fixes mr-orange/Sick-Beard#566