Viewing 15 posts - 34,981 through 34,995 (of 59,099 total)
Dave Ballantyne (2/18/2011)
Surprised that no one has mentioned using a calendar table so far.Makes it all pretty simple.
Check my code where I mentioned the possible use of a Calendar...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2011 at 5:52 am
I got a late start on this one. It's after 2AM here and I have to be up-and-at-em in 3 hours. I apologize but, unless someone else wants...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 18, 2011 at 12:07 am
No doubt about it... both of those pieces of code find the 3rd Friday of each month. But that's only the first part of the problem. If we...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 11:22 pm
Sometimes I just overlook the obvious. Thanks for the hint, Chris. I'll see if I can do it with a formula.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 9:31 pm
timotech (2/17/2011)
Thanks Jeff, I'll be expecting.
Ummmm.... based on what I showed you in the previous code, couldn't you be "attemping" instead of "expecting"? 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 9:24 pm
ColdCoffee (2/17/2011)
Jeff Moden (2/17/2011)
CC... try your code against the data I posted. You may have a surprise in store.
Oh yeah, now i get it , Jeff.. completely missed it...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 9:16 pm
chris_n_osborne (2/17/2011)
Jeff Moden (2/17/2011)
SELECT CASEWHEN GETDATE() <= CAST(DATEDIFF(dd,-3,DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0))/7*7+4+14 AS DATETIME) --3rd Friday Current Month
...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:59 pm
It's not my job to judge but I have to say it anyway, Craig... well done not only on the usage of the Tally Table, but also on conveying the...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:50 pm
danielagger98 (2/17/2011)
But if the management wants it, then...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:42 pm
Gromey (2/17/2011)
However, I still believe that any query you can do with a cursor, you can also do with a loop.
With only very rare exceptions, I believe that any query...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:31 pm
GSquared (2/16/2011)[hr"Quirky update" is definitely a cursor. It's just not a declared one. It's all about counting on the engine to process row-by-row in some hoped-for sequence. ...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:25 pm
tfifield (2/17/2011)
Quirky updates ...[snip]... are just too messy in some cases.
Considering that a Quirky update and a cursor written to do the necessary previous row calculations are nearly identical, I...
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:19 pm
YSLGuru (2/24/2009)
corey lawson (12/5/2007)
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 8:09 pm
Actually, these are "double Triangular Joins". Please see the following article for the different types of "square" and "triangular joins".
http://www.sqlservercentral.com/articles/T-SQL/61539/
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 7:38 pm
Heh... dang it... CC beat me this time. 😀
CC... try your code against the data I posted. You may have a surprise in store.
--Jeff Moden
Change is inevitable... Change for the better is not.
February 17, 2011 at 7:32 pm
Viewing 15 posts - 34,981 through 34,995 (of 59,099 total)