Viewing 15 posts - 2,641 through 2,655 (of 3,957 total)
Here's another way. Comments in the code tell you the right way to do it.
CREATE TABLE #Persons
(Name VARCHAR(20), Birth_Date DATE, Death_Date DATE
...
October 3, 2012 at 7:37 pm
For anyone that's interested in these rCTEs and because there's been a recent flurry of possible uses appear in the forums, I took another look trying to improve the speed.
I...
October 3, 2012 at 7:00 pm
Jeff Moden (10/3/2012)
dwain.c (10/3/2012)
Cadavre (10/3/2012)
dwain.c (10/3/2012)
Jason-299789 (10/3/2012)
October 3, 2012 at 6:16 pm
Cadavre (10/3/2012)
dwain.c (10/3/2012)
Jason-299789 (10/3/2012)
October 3, 2012 at 7:32 am
GSquared (10/3/2012)
dwain.c (10/1/2012)
You may want to take a look at this article, by our own, beloved Joe Celko: http://www.simple-talk.com/sql/t-sql-programming/contiguous-time-periods/
The solution Joe provides doesn't actually prevent gaps. The PreviousEndDate column...
October 3, 2012 at 7:30 am
Jason-299789 (10/3/2012)
October 3, 2012 at 6:12 am
Jeff Moden (10/3/2012)
Jason-299789 (10/3/2012)
Jeff was making valid point about about how to create the Tally table in the first place, most people will write a while loop, or a recursive...
October 3, 2012 at 6:04 am
MM,
I don't know if you're familiar with the "Sweden Redistricting" problem, but it is mentioned at the bottom of the page in this thread: http://www.sqlservercentral.com/Forums/Topic1318149-392-5.aspx.
I spent two weeks working on...
October 3, 2012 at 5:20 am
karthik M (10/2/2012)
Jeff,
Coming back to your question, count 1 to 100,
select sum(n) from tally where n < 101
am i right 🙂
How about:
SELECT 50*101
instead?
Seriously, I don't think that...
October 2, 2012 at 11:09 pm
Lowell - Mister Magoo has pointed you in the right direction and his analysis to reduce the initial rowset based on the cents was really good.
His approach is similar to...
October 2, 2012 at 7:54 pm
PhilPacha (10/2/2012)
Actually, the date rounds up from noon, onwards, not just after noon.
Thanks Phil. An important clarification.
October 2, 2012 at 7:45 pm
WayneS (10/2/2012)
One minor nit-picking comment. You initialize the dates like this:
DECLARE @Date1...
October 2, 2012 at 7:44 pm
I thought it might be interesting to approach this with a recursive CTE, such as the following. Try this setup data:
declare @Person table
(Id int IDENTITY, Name varchar(20), MartialStatus...
October 2, 2012 at 7:03 pm
ScottPletcher (10/2/2012)
dwain.c (9/26/2012)
Using it, I'd like to offer a slightly less verbose solution:
SELECT *, WaitTime=DATEDIFF(minute
,CAST(check_in AS TIME)
,CAST(STUFF(appt_time, 3,...
October 2, 2012 at 6:35 pm
dwain.c (10/2/2012)
kk 93815 (10/2/2012)
Thanks laurie. we are using 2005I think both solutions should run on SQL 2005.
:w00t::hehe::w00t:Didn't look at the setup data.:hehe::w00t::hehe:
October 2, 2012 at 5:03 am
Viewing 15 posts - 2,641 through 2,655 (of 3,957 total)