select sum(t.faccountbalance) as faccountbalance,
       sum(t.ftodayinamount)  as ftodayinamount,
       sum(t.ftodayoutamount) as ftodayoutamount,
       sum(t.ffreezamount)    as ffreezamount
from (
         select isnull(t1.faccountbalance, 0) as faccountbalance,
                0                             as ftodayinamount,
                0                             as ftodayoutamount,
                0                             as ffreezamount
         from tenterprise_users t1
         where t1.siteid = $siteid$ and t1.tenterprise_userid = $tenterprise_userid$
         union all
select 0 as faccountbalance, isnull(sum(t1.famount), 0) as ftodayinamount, 0 as ftodayoutamount, 0 as ffreezamount
from TUSERACCOUNTDETAILS t1
where t1.siteid = $siteid$
  and t1.tenterprise_userid = $tenterprise_userid$
  and t1.ftype = 'ΚΥΘλ'
  and convert (varchar (10)
    , t1.createdate
    , 120) = convert (varchar (10)
    , GETDATE()
    , 120)
union all
select 0 as faccountbalance, 0 as ftodayinamount, isnull(sum(t1.famount), 0) as ftodayoutamount, 0 as ffreezamount
from TUSERACCOUNTDETAILS t1
where t1.siteid = $siteid$
  and t1.tenterprise_userid = $tenterprise_userid$
  and t1.ftype = 'Φ§³φ'
  and convert (varchar (10)
    , t1.createdate
    , 120) = convert (varchar (10)
    , GETDATE()
    , 120)
union all
select 0 as faccountbalance, 0 as ftodayinamount, 0 as ftodayoutamount, isnull(t1.ffreezamount, 0) as ffreezamount
from ACCOUNTFREEZ_VIEW t1
where t1.siteid = $siteid$
  and t1.tenterprise_userid = $tenterprise_userid$
    ) t