Abraham Olatubosun

Abraham Olatubosun

  • NA
  • 471
  • 114.6k

Multiple Sql Statement Not Returning A Datatable

Jan 10 2017 7:57 AM
Dear Code Masters,
   I believe all of you are doing fine, i have a SQL challenge kindly view the image below 
 
what i want to achieve is the SQL statement that will  use "Select " Statement to read the table for State, LGA, Facility Name, Month1, Month2, Year Range Year1 to Year2 and Thematic Area.
 i have tried the following statement "Select * from VW_ART WHERE states='Enugu' and lga ='Udi' and Facname ='Udi Districts Hospital' AND years = '2015' OR (years= '2016' and months IN ('January' , 'December')) "
Which is not returning any records and the records are present but when i make the Year 2016 both it work
 Then if i state Months say from April to May 2016 for both, i expect two months it will display all the records in the data base.
Kindly assist me with thanks 

Answers (5)