select * from institution where ip1=54&netmask1 and ip2=234&netmask2 and ip3=233&netmask3 and ip4=157&netmask4 and datefrom<='2016' and dateto>='2016' and journal='was'