Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

multiple aggregation using pivot in sqlserver

$
0
0
I have a  table Events

Events containing

cardno,time,id,name--each id has a cardno



my requirement is every day each employee swipe the card several times

i want to calculate first and last time of each card

the output should be

name     1                       2                             .............31
           in       out            in        out                   
xxx      09:30     06:30      09:40   06:45
where 1,2...... are dates for example january 1,2, etc.

how it is posssible

Regards
Baiju

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>