January 29, 2016 at 6:37 am
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
January 29, 2016 at 7:02 am
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
January 29, 2016 at 7:40 am
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
January 29, 2016 at 7:42 am
Thank you.
January 29, 2016 at 7:44 am
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
January 29, 2016 at 8:31 am
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