Forum Replies Created

Viewing 15 posts - 421 through 435 (of 1,923 total)

  • RE: Query Help

    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...

  • RE: tuning of the query

    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...

  • RE: Query Help

    Sean Lange (3/13/2012)


    Well sure Ron

    I'm not Ron 😉

  • RE: Query Help

    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'

    ...

  • RE: Query Performance

    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

  • RE: inline query solution

    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

    ...

  • RE: inline query solution

    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...

  • RE: SQL Like Clause

    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...

  • RE: SQL Like Clause

    Remove all occurrences of % from the input string using

    REPLACE(@FirstName , '%','') and then pass it on to query!

  • RE: Sorting comma separated numbers

    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...

  • RE: Sql Question

    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...

  • RE: HELP with a query

    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?

  • RE: HELP with a query

    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...

  • RE: Group adjacent records with repeating attributes

    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...

  • RE: Group adjacent records with repeating attributes

    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...

Viewing 15 posts - 421 through 435 (of 1,923 total)