CREATE OR REPLACE VIEW radius.ACCT_VIEW AS
SELECT 
    nasipaddress, 
    substring(calledstationid, 1, 17) AS calledstationid, 
    callingstationid, 
    acctstarttime, 
    acctstoptime, 
    acctinputoctets, 
    acctoutputoctets, 
    acctssid, 
    acctstoptime AS lastactiondate, 
    acctl2interface
FROM radius.radacct