I have the above table wherein I need to get NoteIndx matching today's date. Just for testing, assume today is 2013/06/02 (Jun 2,2013) and that would get me two records with noteindx 93105 and 104044.
But the correct value here is 104044 as I need to choose the one that has shortest datespan of STRTDATE and ENDDATE.
I am trying with various sql queries but not getting correct result so far.
Can anyone help me with the best possible query to get above results?
Thanks.