Rlm sqlcounter -- Data Based Counter

tnt at kalik.net tnt at kalik.net
Tue Dec 2 22:31:58 CET 2008


>#query = "SELECT SUM(OctetTotal) FROM thismonthsusage WHERE
>UsernameView='%{%k}'"
>}
>
..
>As soon as a new month rolls over there are NO accounting entries for that
>user for that month, hence no record and freeradius denies user as he hasn't
>got any entries, any body know how I should modify the view to display all
>users even if they don't have an entry for current month, but rather display
>them with value 0 as apposed to not at all?
>

Your question belongs on the MySQL forum. Use if() function:

SELECT IF(SUM(OctetTotal) IS NULL, 0, SUM(OctetTotal)) FROM ...

Ivan Kalik
Kalik Informatika ISP




More information about the Freeradius-Users mailing list