﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Steve Jones / Article Discussions / Article Discussions by Author  / NOT BETWEEN / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 23 May 2013 00:14:17 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>OMG I confused that may ne NOT BETWEEN '2012/1/2' AND '2012/1/5'includes the dates used in not between clause also and i put 4 as answer...:( :( :(Well, learn something new today</description><pubDate>Wed, 10 Oct 2012 00:49:53 GMT</pubDate><dc:creator>kapil_kk</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Thanks for the interesting and easy question.</description><pubDate>Wed, 11 Apr 2012 07:57:30 GMT</pubDate><dc:creator>zymos</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Nice and easy one to end the week on. Thanks Steve!</description><pubDate>Mon, 02 Apr 2012 07:23:04 GMT</pubDate><dc:creator>KWymore</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>I was expecting a trick to this one and was very relieved to get it right.  Just proves that sometimes you have to go with your instinct.:-D</description><pubDate>Mon, 02 Apr 2012 03:53:18 GMT</pubDate><dc:creator>skanker</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Good Question.....</description><pubDate>Mon, 02 Apr 2012 03:12:46 GMT</pubDate><dc:creator>baabhu</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Nice &amp; Easy one...</description><pubDate>Mon, 02 Apr 2012 00:30:43 GMT</pubDate><dc:creator>Hardy21</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Should have read the question better. Missed my point because I didn't read NOT BETWEEN.</description><pubDate>Sun, 01 Apr 2012 07:03:45 GMT</pubDate><dc:creator>Britt Cluff</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Nice easy question, thanks.I spent a liitle time poring over it looking for some liitle snag that could make 2 the wrong answer; but then I remembered there was a very similar question recently (BETWEEN instead of NOT BETWEEN, also don with dates, even the same 6 dates in the table if I recall correctly) and that one had no little tricks, so decided that probably this one was OK too.</description><pubDate>Fri, 30 Mar 2012 14:52:44 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>The only hesitation I had is that I use BETWEEN enough to know that it's inclusive at the lower and upper bounds, but don't use NOT BETWEEN very often so I thought maybe NOT BETWEEN would be exactly opposite and the lower/upper bounds would be exclusive so almost went with 4 rows returned, but went with gut and got it right.</description><pubDate>Fri, 30 Mar 2012 11:53:42 GMT</pubDate><dc:creator>lbrigham</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Thanks for the easy question. I also was hesitant at first thinking it was too easy.Have a nice weekend, everyone."El" Jerry.</description><pubDate>Fri, 30 Mar 2012 10:20:17 GMT</pubDate><dc:creator>EL Jerry</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>[quote][b]dipmala.shende (3/30/2012)[/b][hr]Hi..I got 1,6 as output..I run this query on SQL server and got the same output.Please let me know how we can get 2 as output.[/quote]The request was number of rows</description><pubDate>Fri, 30 Mar 2012 09:58:29 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Amazing that we are nearly 20 comments in and no one complained about the date format regional issue.  Of course, that might be because the results would be the same in other regions....</description><pubDate>Fri, 30 Mar 2012 09:13:05 GMT</pubDate><dc:creator>jeff.mason</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>I am a little surprised at the number of people that got this wrong. Maybe they read it wrong or looked at it too quickly. This is a straight back to basics logic question. While yes I agree with the others I was a little hesitant since it seemed too easy. Thanks for the nice light thinking after a long week.</description><pubDate>Fri, 30 Mar 2012 08:55:10 GMT</pubDate><dc:creator>DBA_Dom</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>thx for easy point.</description><pubDate>Fri, 30 Mar 2012 08:00:20 GMT</pubDate><dc:creator>Danny Ocean</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Nice n easy question to finish off the week. It's one of those, "No, it can't be this easy" kind of questions. Always looking for the QotD trick, but there was none...this time. (Insert evil laugh in background here, 'Muhahahaha' :laugh:) Great question.</description><pubDate>Fri, 30 Mar 2012 07:07:30 GMT</pubDate><dc:creator>Dana Medley</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>I guessed 2 because BETWEEN is inclusive, and then I tried to run it.  I found out that I needed SQL Server 2008 compatibility, don't have that, only 2005, so I changed the VALUES clause to UNIONs, and the DATE to DATEtime, then fuond out I had to be logged in as dbo, don't have that either, so I took the dbo. off of the select, and then it returned two rows, voilà!CREATE TABLE SalesDates(id INT, saledate DATEtime);goINSERT INTO SalesDatesSELECT  1, '2012/1/1'UNIONSELECT  2, '2012/1/2'UNIONSELECT  3, '2012/1/3'UNIONSELECT  4, '2012/1/4'UNIONSELECT  5, '2012/1/5'UNIONSELECT  6, '2012/1/6';go SELECT id FROM SalesDates s WHERE s.saledate NOT BETWEEN '2012/1/2' AND '2012/1/5';goDROP TABLE SalesDates;</description><pubDate>Fri, 30 Mar 2012 05:57:26 GMT</pubDate><dc:creator>benkoskysa</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>[quote][b]Carlo Romagnano (3/30/2012)[/b][hr][quote][b]cengland0 (3/30/2012)[/b][hr]This one was so easy that I was looking for the "trick."  I kept look and looking but never found one so I finally submitted my answer.  I was relieved to see that I got it right.  The amount of tension waiting to see the "You got it right" message was overwhelming.[/quote]+1I do not like qotd too easy or without tricks.:w00t:[/quote]I get paranoid when the question SEEMS too easy. Sometimes life really is that easy - strange but true. :-)</description><pubDate>Fri, 30 Mar 2012 05:26:47 GMT</pubDate><dc:creator>Thomas Abraham</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>[quote][b]cengland0 (3/30/2012)[/b][hr]This one was so easy that I was looking for the "trick."  I kept look and looking but never found one so I finally submitted my answer.  I was relieved to see that I got it right.  The amount of tension waiting to see the "You got it right" message was overwhelming.[/quote]+1I do not like qotd too easy or without tricks.:w00t:</description><pubDate>Fri, 30 Mar 2012 03:20:23 GMT</pubDate><dc:creator>Carlo Romagnano</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Easy point today - thanks Steve</description><pubDate>Fri, 30 Mar 2012 02:56:22 GMT</pubDate><dc:creator>Stuart Davies</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Thanks for the easy QOTD!</description><pubDate>Fri, 30 Mar 2012 02:39:38 GMT</pubDate><dc:creator>palotaiarpad</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>This one was so easy that I was looking for the "trick."  I kept look and looking but never found one so I finally submitted my answer.  I was relieved to see that I got it right.  The amount of tension waiting to see the "You got it right" message was overwhelming.</description><pubDate>Fri, 30 Mar 2012 02:21:33 GMT</pubDate><dc:creator>cengland0</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Nice QOTD to end the week.Thanks Steve.</description><pubDate>Fri, 30 Mar 2012 01:53:10 GMT</pubDate><dc:creator>paul s-306273</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Thanks Steve for an easy question to finish the week!</description><pubDate>Fri, 30 Mar 2012 01:53:09 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>just wake up from snap. I miss NOT BETWEEN --&amp;gt; BETWEEN so my answer: 4 :hehe:</description><pubDate>Fri, 30 Mar 2012 01:13:27 GMT</pubDate><dc:creator>nghiavt</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>The question asked [b]how many[/b] rows are returned. It didn't ask [b]which[/b] rows were returned.Dave</description><pubDate>Fri, 30 Mar 2012 00:54:38 GMT</pubDate><dc:creator>Dave Brooking</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Hi..I got 1,6 as output..I run this query on SQL server and got the same output.Please let me know how we can get 2 as output.</description><pubDate>Fri, 30 Mar 2012 00:03:10 GMT</pubDate><dc:creator>dipmala.shende</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>We like these questions that require fewer brain cells to cap the week.</description><pubDate>Thu, 29 Mar 2012 22:23:18 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Good question Steve.</description><pubDate>Thu, 29 Mar 2012 21:50:19 GMT</pubDate><dc:creator>mohammed moinudheen</dc:creator></item><item><title>RE: NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Nice easy one to end the week ....</description><pubDate>Thu, 29 Mar 2012 21:28:22 GMT</pubDate><dc:creator>bitbucket-25253</dc:creator></item><item><title>NOT BETWEEN</title><link>http://www.sqlservercentral.com/Forums/Topic1275491-32-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/88647/"&gt;NOT BETWEEN&lt;/A&gt;[/B]</description><pubDate>Thu, 29 Mar 2012 21:27:48 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item></channel></rss>