Counting voucher value total since the beginning of the month
I have a table called "vouchers" it contains fields named "voucher_value" and "redeemed_at". redeemed_at is in Unix timestamp format (generated by PHP time() function).
So I need get the total of voucher_value since the beginning of the month.
What's the SQL code for that?
what have you tried?
Hint, since you've stored values in UNIXTIME you'll have to convert that column using FROM_UNIXTIME.
Also note it would be much easier if you merely used now() directly in mysql to update that column, then no conversion is necessary.