Hey thanx for that Marnus . Thats working just exactly how i wanted :) . Damon i actually came up with same row/60+0.5 then roundup trick when i was doing something same in excel sheets :) and its useful<br>for billing in 1 minute roundup ( 60 sec pulse ) but i failed to get it working for 6 second pulse .
<br>Marnus's sql query is perfect .. now suppose charge is 1.5 cent /min then i can used 6 second round up'd value and multiple by 0.15 to get call bill in cent and it can also be used for 30 second pulse or any other value with small modification .. Thx .
<br><br><div><span class="gmail_quote">On 14/11/06, <b class="gmail_sendername">Marnus van Niekerk</b> <<a href="mailto:m@mjvn.net">m@mjvn.net</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
<div bgcolor="#ffffff" text="#000000"> Supposing you have an extra column called 6second:<br><br> UPDATE cdr SET 6second=billsec+(6-mod(billsec,6) where 6second=0<br><br> if you want a decimal minutes column called billmin
<br><br> UPDATE cdr SET billmin=round((billsec/60)+0.5),1) where billmin=0<span class="q"><br><br><br> Vicky wrote: <blockquote cite="http://midff95c3730611131151y20af13a9q2300d845d8d0d191@mail.gmail.com" type="cite">Thx and what would the sql query be ? . I plan to put additional field as 6second .
<br> How can i make billsec of values of whole table get rounded and filled in field "6second"<br> Sorry i am a noob with mysql :D <br><br><div><span class="gmail_quote">On 14/11/06, <b class="gmail_sendername">
James Coberly</b> <<a href="mailto:james.coberly@xmc.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">james.coberly@xmc.com</a>> wrote:</span> <blockquote class="gmail_quote" style="border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.80ex; padding-left: 1ex">
<div> sum(duration+(6-mod(duration,6) for summary of seconds divisible by 6, /60 for minutes<span><br></span></div></blockquote></div></blockquote><br></span></div><br>_______________________________________________<br>--Bandwidth and Colocation provided by
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://Easynews.com" target="_blank">Easynews.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">
http://lists.digium.com/mailman/listinfo/asterisk-users</a><br><br><br></blockquote></div><br>