Please need help to get result from below query

  • Hi I am having below query.

    t_item t_cwart_trdt t_clot t_qstkt_ocmpt_kost

    WIP000437105RS12015-12-03 00:00:00.000021215FRS000065832 242105 3

    WIP000437105RS12015-12-09 00:00:00.000021215FRS000065832 242105 5

    I am looking result as below.

    t_item t_cwart_trdt Receipt Date DateDiff t_clot t_qstkt_ocmpt_kost

    WIP000437 105RS12015-12-03 00:00:00.0002015-12-09 00:00:00.000 6 021215FRS000065832 242105 5

  • You didn't include any query, nor any logic describing the output.

    Help us help you by providing CREATE TABLE, INSERTS of data and said logic explaining your expected output.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • maybe ?

    SELECT t_item,

    t_cwar,

    MIN(t_trdt),

    MAX(t_trdt),

    DATEDIFF(day, MIN(t_trdt), MAX(t_trdt)),

    t_clot,

    t_qstk,

    t_ocmp,

    MAX(t_kost)

    FROM myquery

    GROUP BY t_item,t_cwar,t_clot,t_qstk,t_ocmp

    ;

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • Thank you.

  • patla4u (1/29/2016)


    Thank you.

    you are welcome, but please next time, heed the advice in this post http://spaghettidba.com/2015/04/24/how-to-post-a-t-sql-question-on-a-public-forum/

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • OK.

    Thank you.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply