April 9, 2014 at 2:33 am
Dear All,
Need help to build query ,Data in the below format
Name Dept Punch Date Status
Robin Purchase 4/3/14 18:00 Out
Robin Purchase 4/3/14 17:57 In
Robin Purchase 4/3/14 15:04 Out
Robin Purchase 4/3/14 14:20 In
Alex Accounts 4/3/14 14:09 Out
Alex Accounts 4/3/14 14:07 In
Alex Accounts 4/3/14 10:53 Out
Alex Accounts 4/3/14 7:52 In
I need the query which gives the output in the below Format
Name Dept Punch Date Status
Robin Purchase 4/3/14 18:00 Out
4/3/14 17:57 In
4/3/14 15:04 Out
4/3/14 14:20 In
Alex Accounts 4/3/14 14:09 Out
4/3/14 14:07 In
4/3/14 10:53 Out
4/3/14 7:52 In
Thanks and Regards
Prakash
April 9, 2014 at 3:41 am
You cannot just have less columns on a row then on another row.
Formatting output is better done with a front-end application, like SSRS.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
April 10, 2014 at 4:49 am
Keon is right, sounds like you just want a simple SSRS report grouped by Name.
April 10, 2014 at 4:51 am
Dang, sorry spelled "Koen" wrong.
April 10, 2014 at 5:10 am
Michael_Garrison (4/10/2014)
Dang, sorry spelled "Koen" wrong.
No problem.
There is an "edit" button by the way.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
June 5, 2014 at 9:27 pm
select name,dept, punchdate ,status from Table_name
where name='robin'
select name,dept, punchdate ,status from Table_name
where name='Alex'
June 5, 2014 at 11:59 pm
manju00005 (6/5/2014)
select name,dept, punchdate ,status from Table_namewhere name='robin'
select name,dept, punchdate ,status from Table_name
where name='Alex'
The original question was about formatting, not about how to select the data.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy