I have table where date is stored as 3 columns in the table, i.e as below
`periodYear`
`periodMonth`
`billDay`
Which is causing me problems, when i want to generate reports based on the DATE which is a combination of above three. for example
SELECT SUM(amount) as Total,
FROM invoice
WHERE `periodYear` = 2014,
GROUP BY `billDay`,`periodMonth`,`periodYear`
Can somebody help me to explain how to solve this problem ?
For example I want to list all the totals last year on daily base,
If it's a date column, I could have just group by date, but in this case I don't know how to do that, because if you group by billday,..,., then it going group based on the day not DATE.. you see what I mean ?