February 17, 2011 at 2:33 pm
In Access, I used First function as below to make data from 1) to 2) as below query:
SELECT ID, DATEFROM,
First(duration) AS duration, First(DATETO) AS DATETO,
First(ORDERID) AS ORDERID
FROM TABLE1
GROUP BY MEMBID, DATEFROM
How to code in SQL to make result as 2)?
1)
ID---------DATEFROM--DURATION-DATETO---------ORDERID
06000031--2009-07-22------13---2009-08-06------226209
06000031--2009-07-22------20---2009-08-13------640173
06000031--2010-04-09------4----2010-04-15------226209
2)
ID---------DATEFROM--DURATION-DATETO---------ORDERID
06000031--2009-07-22------13---2009-08-06------226209
06000031--2010-04-09------4----2010-04-15------226209
February 17, 2011 at 2:37 pm
Please don't start a new thread if you have additional information to a question already posted.
Original post including a first reply can be [url=found http://www.sqlservercentral.com/Forums/FindPost1065768.aspx%5Dhere%5B/url%5D%5B/b%5D
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply