Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

SQL Query

Avatar of anastasiasoul
anastasiasoulFlag for United Kingdom of Great Britain and Northern Ireland asked on
Oracle DatabaseMySQL Server
4 Comments1 Solution249 ViewsLast Modified:
Hi, Guys
I need to list all the patients admitted within the year to date. The query attached returns the empty set although there are definetely records to be returned. Where is my mistake?
Thanks
select 
admission.adno,
admission.pno, 
patient.psurname,
SUBDATE(`currentdate`, INTERVAL 365 DAY)as to_date
from patient, admission, currentdate
where 
patient.pno = admission.pno
and admission.indate between  
currentdate and SUBDATE(`currentdate`, INTERVAL 365 DAY);
ASKER CERTIFIED SOLUTION
Avatar of Kim Ryan
Kim RyanFlag of Australia imageIT Consultant

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers