Hey
I have a bunch of .sql files that I have created. These querys will be run every month for my friendly neighborhood bean counter. Each query has two Epoch millisecond values to indicate what range of dates to count the totals from. Im trying to figure out a way to update the epoch values automagically every month before the query is executed. The dates will allways be between the first and last day of the month. I figure this is a bash scripting job where sed parses the .sql file and inserts the values in the correct place.
Im pretty much a total newbie so any suggestions to point me in the right direction (or even the solution!!
and I would be extremely grateful.
Below is a typical query for the first of june to the 30th.
select shortcode.short_code as shortcode, xml.client_config.name as client, operators.name as operator,
count(*) as del from xml.sent_messages, xml.client_config, operators, shortcode where xml.sent_messages.client_id = xml.client_config.client_id and xml.sent_messages.shortcode_id = shortcode.id and xml.sent_messages.operator_id = operators.id and shortcode.id = 4 and DELIVERY_STATUS = 1 and DELIVERY_DATE between 1180652400364 and 1183244399052 group by shortcode.short_code, xml.client_config.name, operators.name;
Ps It aint my database so I *must* use the Epoch milliseconds.
Regards
Eamo