Viewing 15 posts - 1,486 through 1,500 (of 3,957 total)
aslam.jeewa (9/12/2013)
I now need to run...
September 12, 2013 at 7:18 pm
Which of these is closer to the end of the week?
SELECT DATEADD(millisecond, -1, CAST('2013-09-13' AS DATETIME2))
,DATEADD(microsecond, -1, CAST('2013-09-13' AS DATETIME2))
September 12, 2013 at 7:12 pm
You might want to Google on calendar tables, because I believe you're going to need one to generate a sequence of months back in time as far as you want...
September 12, 2013 at 7:07 pm
I love hierarchy problems. If Jeff's articles don't help you, I suggest you post DDL, some sample data and the expected results.
Along will come many I'm sure offering various...
September 12, 2013 at 7:00 pm
ChrisM@home (9/12/2013)
paulcauchon (9/12/2013)
Originally, we had been treating the...
September 12, 2013 at 6:48 pm
You can try this:
WITH SampleData (col) AS
(
SELECT 'Foodhold USA,mlc.'
UNION ALL SELECT 'Beverage Partners Worldwide (North canada)......'
UNION ALL SELECT 'Bread World 8'''
),
Tally (n) AS
(
SELECT ROW_NUMBER() OVER (ORDER BY (SELECT...
September 12, 2013 at 6:43 pm
What happens if the credit amount is larger than the total for all other rows?
Or is some sort of matching required to exclude only the row with the matching amount...
September 12, 2013 at 6:29 pm
Jack Corbett (9/12/2013)
Brandie Tarvin (9/12/2013)
Go to http://www.sqlsaturday.com and see if there is a way to register for event notifications. That way if one pops up near you again,...
September 12, 2013 at 6:10 pm
Thanks for letting me know.
I assume the second one, being simpler, should be faster. If you can confirm that, it would be interesting too.
Have a good day.
September 12, 2013 at 5:05 pm
Jeff Moden (9/12/2013)
dwain.c (9/11/2013)
Jeff Moden (8/31/2013)
September 12, 2013 at 6:18 am
ChrisM@Work (9/12/2013)
Blimey. I've learned so much from your website over the years. Nice - and a privilege - to see the tables turned.
I would have to second that.
September 12, 2013 at 3:07 am
You can do away with the temporary table.
with t4 as (
select '2011-01-02' as dd, 123 as prodID union
select '2011-01-03' as dd, 345 as prodID union
select '2011-01-04' as dd, 345 as...
September 11, 2013 at 10:23 pm
BTW. I really like this.
Jeff Moden (8/31/2013)
September 11, 2013 at 9:44 pm
Another way that should look familiar:
WITH Amt (Amt) AS (SELECT 2000)
SELECT RIGHT(10000000000000+Amt*100,13)
FROM Amt;
September 11, 2013 at 9:39 pm
If they're always squares, perhaps something like this?
WITH Squares
(
Upperleft_X, Upperleft_Y, Upperright_X, Upperright_Y
,Lowerleft_X, Lowerleft_Y, Lowerright_X, Lowerright_Y, Cell
) AS (
...
September 11, 2013 at 9:12 pm
Viewing 15 posts - 1,486 through 1,500 (of 3,957 total)