Viewing 15 posts - 781 through 795 (of 3,957 total)
Ooops! Silly me, I just realized why that won't work. Try this (assuming this is what Sean meant):
WITH SampleData (Origin, Destination) AS
(
SELECT 1, 2
UNION ALL SELECT 2, 1
UNION...
February 17, 2014 at 5:41 pm
Sean Lange (2/17/2014)
February 17, 2014 at 5:27 pm
Are you looking for a weighted average (by day within date range) for the average exchange rate?
February 17, 2014 at 5:19 pm
Ed Wagner (2/17/2014)
dwain.c (2/16/2014)
Ed Wagner (2/13/2014)
dwain.c (2/13/2014)
Jack Corbett (2/13/2014)
Glad no bare-chested pictures of Grant, or frankly anyone on the thread, have popped up here too.
I guess it is...
February 17, 2014 at 5:14 pm
You might try putting the WHERE clause before ORDER BY instead of where you have it (the subquery that determines the TOP n rows in your Tally table).
February 16, 2014 at 10:36 pm
TheSQLGuru (2/16/2014)
...erg...Now THERE'S a word I haven't heard since I completed my BS in Physics!! Good one!:hehe:
I've got a million of 'em.
THE SEX LIFE OF AN ELECTRON (with unhappy ending)
One...
February 16, 2014 at 7:15 pm
zulfansari (2/16/2014)
Thank you VERY MUCH for the quick solution, I will test this as soon as I get back in the office on Monday..
OK I'll bite. What's a Numbers...
February 16, 2014 at 7:12 pm
Here are 2 more ways:
WITH PreAggregate AS
(
SELECT Symbol, ExpDate
FROM #temp1
WHERE ExpDate > '2014-03'
)
UPDATE a
SET Tag = 1
FROM #temp1...
February 16, 2014 at 7:00 pm
If you really need to eke every last erg of performance out of a replace, consider using a binary collation:
February 16, 2014 at 6:46 pm
I have 2 questions:
1. Where is the subquery? I see a derived table.
2. Are you sure you want to use NOLOCK? There's a lot of potential gotchas in...
February 16, 2014 at 6:33 pm
If you don't have a numbers table at your disposal like Jason does, this will also work.
DECLARE @sometab TABLE (Person INT, [Date] DATE, [Hours] DECIMAL(12,2))
INSERT INTO @sometab
...
February 16, 2014 at 6:30 pm
Note that in your data setup 1-2-2013 translates to Jan 2 2013, but otherwise this should do it for you.
SELECT name1, name2, name3 -- , b.*
,[Jan-13]=MAX(CASE...
February 16, 2014 at 6:18 pm
Ed Wagner (2/13/2014)
dwain.c (2/13/2014)
Jack Corbett (2/13/2014)
Glad no bare-chested pictures of Grant, or frankly anyone on the thread, have popped up here too.
I guess it is fortunate then that...
February 16, 2014 at 5:26 pm
Jack Corbett (2/13/2014)
Glad no bare-chested pictures of Grant, or frankly anyone on the thread, have popped up here too.
I guess it is fortunate then that most of the...
February 13, 2014 at 6:36 pm
Here it is deleting multiple LineIDs from multiple TIDs and then renumbering.
WITH RowsToDelete (TID, LineID) AS
(
SELECT 100, 3 UNION ALL SELECT 200, 2 UNION ALL SELECT...
February 11, 2014 at 6:37 pm
Viewing 15 posts - 781 through 795 (of 3,957 total)