Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
5
Reply
Multiple Sql Statement Not Returning A Datatable
Abraham Olatubosun
Jan 10 2017 7:57 AM
333
Reply
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
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
how to compare given date and 1 day than current date
sql - database schema confusing.