Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««123»»

NOT BETWEEN Expand / Collapse
Author
Message
Posted Friday, March 30, 2012 2:39 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Yesterday @ 4:44 AM
Points: 1,327, Visits: 481
Thanks for the easy QOTD!
Post #1275599
Posted Friday, March 30, 2012 2:56 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 2:57 AM
Points: 3,069, Visits: 3,251
Easy point today - thanks Steve

-------------------------------
Posting Data Etiquette - Jeff Moden
Smart way to ask a question

There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
Post #1275606
Posted Friday, March 30, 2012 3:20 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 1:23 AM
Points: 2,509, Visits: 2,386
cengland0 (3/30/2012)
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.

+1
I do not like qotd too easy or without tricks.
Post #1275615
Posted Friday, March 30, 2012 5:26 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, August 20, 2014 8:26 AM
Points: 1,803, Visits: 2,168
Carlo Romagnano (3/30/2012)
cengland0 (3/30/2012)
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.

+1
I do not like qotd too easy or without tricks.


I get paranoid when the question SEEMS too easy. Sometimes life really is that easy - strange but true.


Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
Post #1275662
Posted Friday, March 30, 2012 5:57 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, June 19, 2014 9:12 AM
Points: 33, Visits: 113
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, voilà!

CREATE TABLE SalesDates
(id INT, saledate DATEtime
);
go
INSERT INTO SalesDates
SELECT
1, '2012/1/1'
UNION
SELECT
2, '2012/1/2'
UNION
SELECT
3, '2012/1/3'
UNION
SELECT
4, '2012/1/4'
UNION
SELECT
5, '2012/1/5'
UNION
SELECT
6, '2012/1/6';
go
SELECT id
FROM SalesDates s
WHERE s.saledate NOT BETWEEN '2012/1/2' AND '2012/1/5';
go
DROP TABLE SalesDates;
Post #1275673
Posted Friday, March 30, 2012 7:07 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Friday, August 29, 2014 7:56 AM
Points: 1,860, Visits: 1,398
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' ) Great question.



Everything is awesome!
Post #1275724
Posted Friday, March 30, 2012 8:00 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 6, 2014 4:15 AM
Points: 1,242, Visits: 1,546
thx for easy point.



Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com

Post #1275765
Posted Friday, March 30, 2012 8:55 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 7:37 AM
Points: 568, Visits: 71,543
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.
Post #1275816
Posted Friday, March 30, 2012 9:13 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 18, 2014 7:25 AM
Points: 989, Visits: 1,823
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....
Post #1275831
Posted Friday, March 30, 2012 9:58 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Friday, August 29, 2014 1:51 PM
Points: 21,644, Visits: 15,317
dipmala.shende (3/30/2012)
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.


The request was number of rows




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1275877
« Prev Topic | Next Topic »

Add to briefcase ««123»»

Permissions Expand / Collapse