select
case
when '2001-04-16' between startdate and enddate and '2011-05-15' between startdate and enddate then 'Yes'
else 'No'
end as inmedicallicense
from table
where id = 1
select *
from tablename
where startdate between '2011-04-16' and '2011-05-15'
or enddate between '2011-04-16' and '2011-05-15'
0
jrthurlerAuthor Commented:
This will not work for me. What I need is to calculate if the employee is out of work in the period specified (in this case he started in medical license in 2010-11-30 and ended in 2011-05-16).
I need to ensure that in the period from '2011-04-16' until '2011-05-15' he was in medical license. If I use your approach (which was what I´m using today) the program will not works fine!
Thanks in advance
0
jrthurlerAuthor Commented:
Thanks for your help, after so many hours working on this system the logical disappears from us...
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
case
when '2001-04-16' between startdate and enddate and '2011-05-15' between startdate and enddate then 'Yes'
else 'No'
end as inmedicallicense
from table
where id = 1