Viewing 15 posts - 916 through 930 (of 1,228 total)
You might want to rewrite it to make it more readable and five times faster:
SELECT
PATID,
CARRIER_ID,
DateRange,
[BAL] = SUM(BAL)
FROM (
SELECT ...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 9:15 am
Let's have a look at a single one of those date-range specific queries:
SELECT ...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 9:04 am
jrbass81 (4/20/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 8:24 am
jrbass81 (4/20/2011)
I need the following listed where ins company carrier ID is only listed once and the total for each is only listed once. I hope that makes sense...SEE ATTACHMENTS
Read...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 8:05 am
shubham.saxena67 (4/20/2011)
Adm_no FirstName Last_name Session Class
01/742 NIKHIL SINGH 2010 - 2011 VIII
01/742 ASHISH SINGH 2011 - 2012 IX
01/743 ANSHIKA GUPTA 2011 - 2012...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 7:58 am
Going back to your earlier post,
sum(bp.gross_quantity / 42.0) as qty_gross,sum(bp.net_quantity / 42.0) as net_qty
FROM [VEMA-FACS1].FUELFACS.dbo.bulk_movement AS bm
INNER JOIN...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 7:53 am
Research PIVOT.
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 7:37 am
david.holley (4/20/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 7:34 am
It doesn't work because '00000000-0000-0000-000-0000000000' won't cast to a uniqueidentifier. Try this:
SELECT CAST('00000000-0000-0000-000-0000000000' AS uniqueidentifier)
SELECT CAST('00000000-0000-0000-0000-000000000000' AS uniqueidentifier)
Why do you want to put this value into a uniqueidentifier column? Why...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 5:03 am
Craig Farrell (4/19/2011)
Brandie Tarvin (4/19/2011)
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 1:30 am
Hi
Is this issue resolved now?
If not, there are a couple of lines of enquiry to follow;
Check if bp.movement_number = 2191 appears in rows other than those where bm.bulk_movement_id IN ('54332','54355','54356')....
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 20, 2011 at 1:18 am
snufse1 (4/19/2011)
FROM[VEMA-FACS1].FUELFACS.dbo.bulk_movement AS bm
INNER JOIN[VEMA-FACS1].FUELFACS.dbo.bulk_product AS bp ON bp.bulk_movement_id = bm.bulk_movement_id
and result is (same as before)
201103302011 MC 01 497883100 859700...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 19, 2011 at 8:43 am
LOL Wayne that was quick!
;WITH VendorCodes AS
(
SELECT [letter] = CHAR(64 + rn)
FROM (SELECT rn = ROW_NUMBER() OVER(ORDER BY [Name]) FROM sys.columns
) d WHERE rn < 27
)
SELECT c1.letter, c2.letter
FROM VendorCodes...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 19, 2011 at 8:29 am
kr.nithin (4/19/2011)
Yep In spite of the Numeric Primary Key. We need 2 character Vendor Code for each vendor.
How many vendors do you currently have? What is the rate at which...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 19, 2011 at 8:08 am
Bob
Have a look at the output from this:
CREATE TABLE #Test ([Response ID] INT, Company VARCHAR(15), Amount MONEY, [Quarter] INT, [Year] INT)
INSERT INTO #Test ([Response ID], Company, Amount, [Quarter], [Year])
SELECT...
For better assistance in answering your questions, please read this[/url].
Hidden RBAR: Triangular Joins[/url] / The "Numbers" or "Tally" Table: What it is and how it replaces a loop[/url] Jeff Moden[/url]
April 19, 2011 at 8:07 am
Viewing 15 posts - 916 through 930 (of 1,228 total)