Viewing 15 posts - 421 through 435 (of 1,923 total)
Again i echo SEan, without a proper way of defining the order, it is impossible to determine the "first row of every set".
But in the meantime, you can munch on...
March 13, 2012 at 1:42 pm
i just moved the datediff to a cross apply so that it is not calculated twice (i assume it is, i may be worng)
UPDATE
SHP_MANIFEST
SET
DELIVERED = D.DELIVERED_PST,
DELIVERED_DATE_DWKEY = CrsApp.DtDiffDlvrdPST
FROM
SHP_DELIVERED_PACKAGES D...
March 13, 2012 at 1:30 pm
I echo Sean. Very nice set-up. Thanks for that!
How about this?
SELECT TUD.Userid , TUD.LocationID
, Ct = CASE WHEN COUNT(*) > 1 THEN 'Multiple'
...
March 13, 2012 at 12:26 pm
Can you provide some more details on what you are trying to acheive? It seems to be easily doable with 1 or 2 select statements
March 12, 2012 at 10:51 pm
inline query:
SELECT C.rid , C.nid , R.rname , N.nname , C.total
, total = ISNULL( (SELECT InrTab.total
FROM cooky InrTab
WHERE InrTab.rid = R.rid - 1
...
March 12, 2012 at 3:38 pm
Your sample data had flaws. i have fixed them and here is the new set of data
if object_id('rooky') is not null
drop table rooky
if object_id('nooky') is not null
drop table nooky
if...
March 12, 2012 at 3:28 pm
Bro, when u see a empty string in the Frist Name text box (or wherever the value for @FirstName comes from) , handle it. Tell the user that it is...
March 12, 2012 at 9:57 am
Remove all occurrences of % from the input string using
REPLACE(@FirstName , '%','') and then pass it on to query!
March 12, 2012 at 9:30 am
Did you create the function in one database and running the query in another database? can you double check that the function you posted has been successfully created on the...
March 11, 2012 at 10:49 pm
How about this?
; WITH CTE (ItemID, RegionID, Quantity) AS
(
SELECT 4003, 5 ,10
UNION ALL SELECT 4134, 5 ,20
UNION ALL SELECT 4003, 55, 70
UNION ALL SELECT 4134, 55 ,40
UNION ALL...
March 11, 2012 at 10:23 pm
may be, but i doubt it. Without seeing data, we really cant guess on whats worng! is it possible to get data or atleast mocked-up data?
March 10, 2012 at 10:35 am
Your query acts upon 3 main columns PRD_HEADER.prdkey, PRD_summary.prdkey & PRD_Unit.PrdKey. You selected only PRD_HEADER.prdkey and PRD_summary.prdkey and u said u did not have any dups; so PRD_HEADER.prdkey and...
March 10, 2012 at 10:14 am
note that i have added a column called "iD" in the set-up; without that, the query wil not work. THe rows must be uniquely-identifiable in an ordered fashion for my...
March 9, 2012 at 6:01 pm
Sample data :
IF OBJECT_ID('TempDB..#Temp') IS NOT NULL
DROP TABLE #Temp;
CREATE TABLE #Temp
( iD INT IDENTITY(1,1)
,ColA INT
,ColB INT
,ColC CHAR(1)
)
INSERT INTO #Temp (ColA , ColB...
March 9, 2012 at 5:58 pm
Viewing 15 posts - 421 through 435 (of 1,923 total)