select ref 'Resource ID',view_title_field 'Title' from resource where ref not in 

(
#Previous query to fetch resource views
select r.ref from resource r,daily_stat d where r.ref=d.object_ref and d.activity_type='Resource view'

# --- date ranges
# Make sure date is greater than FROM date
and 
(
d.year>[from-y]
or 
(d.year=[from-y] and d.month>[from-m])
or
(d.year=[from-y] and d.month=[from-m] and d.day>=[from-d])
)
# Make sure date is less than TO date
and
(
d.year<[to-y]
or 
(d.year=[to-y] and d.month<[to-m])
or
(d.year=[to-y] and d.month=[to-m] and d.day<=[to-d])
)

group by r.ref
)