Translations:SMS handler setup/12/en
select u2.phone,
format(get_string('Q_alert',2), u.firstname||coalesce(' '||u.surname,),
local_phone(u.phone), to_char(report_date,'HH:MM:SS'), question)
from questions q
join users u on u.id = q.userid
join users u2 on (not u2.del) and (u2.phone is not null) and (u2.groupid < 2)
join locations l on l.id = u2.location
join locations l2 on l2.id = u.location
where q.msgid = sms_msgid