<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40"
xmlns:ns0="http://schemas.microsoft.com/office/2004/12/omml">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--a:link
        {mso-style-priority:99;}
span.MSOHYPERLINK
        {mso-style-priority:99;}
a:visited
        {mso-style-priority:99;}
span.MSOHYPERLINKFOLLOWED
        {mso-style-priority:99;}
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:Calibri;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Calibri;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:Verdana;
        color:navy;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Verdana;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'>Sorry, correction (on last line):<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>If I understand your problem correctly, the following should work:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>WHERE <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>
-- those that begin inside the range period:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'>(START >= RangeStart AND START <=
RangeEnd) OR<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>
-- those that end inside the range period:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'> (END >= RangeStart AND END <=
RangeEnd) OR<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'>-- those that begin before and end after
the range period:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'>(START < RangeStart AND END >
RangeEnd) <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt;font-family:"Times New Roman"'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Xander (GMail)
[mailto:xandervdm@gmail.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Sunday, January 31, 2010
10:45 AM<br>
<b><span style='font-weight:bold'>To:</span></b> '<st1:PersonName w:st="on">NZ
Borland Developers Group - <st1:place w:st="on">Delphi</st1:place> List</st1:PersonName>'<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [DUG] another set of
eyes</span></font><font size=3 face="Times New Roman"><span style='font-size:
12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'>Hi Jeremy,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>If I understand your problem correctly, the following should work:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>WHERE <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>
-- those that begin inside the range period:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'>(START >= RangeStart AND START <=
RangeEnd) OR<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>
-- those that end inside the range period:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'> (END >= RangeStart AND END <=
RangeEnd) OR<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'>-- those that begin before and end after
the range period:<o:p></o:p></span></font></p>
<p class=MsoNormal style='text-indent:36.0pt'><font size=2 face=Calibri><span
lang=EN-NZ style='font-size:11.0pt'>(START <= RangeStart AND END <
RangeEnd) <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Verdana><span style='font-size:
10.0pt;font-family:Verdana;color:navy'>Cheers<o:p></o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt;font-family:"Times New Roman"'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
delphi-bounces@delphi.org.nz [mailto:delphi-bounces@delphi.org.nz] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Jeremy Coulter<br>
<b><span style='font-weight:bold'>Sent:</span></b> Sunday, January 31, 2010
9:54 AM<br>
<b><span style='font-weight:bold'>To:</span></b> '<st1:PersonName w:st="on">NZ
Borland Developers Group - <st1:place w:st="on">Delphi</st1:place> List</st1:PersonName>'<br>
<b><span style='font-weight:bold'>Subject:</span></b> [DUG] another set of eyes</span></font><font
size=3 face="Times New Roman"><span style='font-size:12.0pt;font-family:"Times New Roman"'><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=2 face=Calibri><span style='font-size:11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>Hi All.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>I am the stage with problem that SOMEONE who’s a bit more lateral
thinking than me might be able to see the solution.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>I have the following data (just a snapshot).<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>Item Start
End<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>1 15 Feb
2010 26 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>2 22 Feb
2010 26 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>3 15 Feb 2010
29 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>4 24 Feb
2010 25 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>5 23 Feb
2010 25 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>6 24 Feb
2010 31 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>7 22 Feb
2010 26 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>8 23 Feb
2010 24 Feb 2010<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>What I am doing is TRYING to find all items that fall between a given
date range.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>In this case I am trying to find all the items between the 22 Feb and
26 Feb.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>i.e. all of the items should be returned in the above snap shot.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>I am trying the following where clause (not real field names):-<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>WHERE (#22 FEB 2010 13.00.00# Between START And END)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>AND (#26 FEB 2010 10.00.00# Between START And END)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>However, that missed out Items 1,34,5,6 and I think 8.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>If I try:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>WHERE START >=#22 FEB 2010 13.00.00# And ENDTIME <=#26 FEB 2010
10.00.00# <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>It misses out 1,3 and 6<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>I cant go<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>WHERE START >=#22 FEB 2010 13.00.00# or ENDTIME <=#26 FEB 2010
10.00.00# as that returns to many records.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>Can anyone see what I am missing? I don’t mind if I have to do it
in separate queries as I can just union them, but I have been looking at this
too long and I just cant figure it out, so I thought another set of eyes might
help </span></font><font face=Wingdings><span lang=EN-NZ style='font-family:
Wingdings'>J</span></font><span lang=EN-NZ><o:p></o:p></span></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'>Thanks, Jeremy<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Calibri><span lang=EN-NZ style='font-size:
11.0pt'> <o:p></o:p></span></font></p>
</div>
</body>
</html>