emurad — 2011-03-17T10:56:30-04:00 — #1
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?
guelphdad — 2011-03-17T13:35:29-04:00 — #2
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.