TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rajkumar R
NA
183
220k
Sqlserver query
Oct 27 2012 2:14 AM
I have i table like this with values
Acall1 Acall2 Acall3... Acall6 Icall1 icall2... iCall6 Login Salesrep
23/10/2012 23/10/2012 23/10/2012 23/10/2012 2/2/2012 2/2/2012 2/2/2012 PL Paul
null 2/2/20112 null 2/2/20112 2/2/20112 2/2/20112 null PL Paul
2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 AN Answer
2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 CM Campel
2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 2/2/20112 MU Merry
23/10/2012 23/10/2012 23/10/2012 23/10/2012 2/2/20112 2/2/20112 2/2/20112 PL ALex
I need output for last seven days any of the Acall or Icall havinig ast seven days.
Output. This for Admin login
salesrep oct20 oct21 oct22 oct23 oct24 oct25 oct26
Paul 0 0 0 4 0 0 0
Answer 0 0 0 0 0 0 0
Campel 0 0 0 0 0 0 0
Merry 0 0 0 0 0 0 0
Alex 0 0 0 4 0 0 0
Here PL login have two sales reps i want to show this in two different rows.
If i login as PL then it should show where salesrep=paul and ALEX in tow rows.
FOR PL Login Sample output like this..
salesrep oct20 oct21 oct22 oct23 oct24 oct25 oct26
Paul 0 0 0 4 0 0 0
Alex 0 0 0 4 0 0 0
Please post solution for this.
Thanks in advance
Reply
Answers (
0
)
How we can generate a alpha-numeric CustomerID in sql server
how to get records from specific date