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
Arti Sonkar
NA
117
2.1k
getting wrong Total time
Mar 27 2020 4:25 AM
;with cte
as
(
select action.Id as intid, ex.ExecutiveName,cast(tkt.ActionDateTime
as date )as Date,DATENAME(dw,tkt.ActionDateTime) as Day
from TicketInteractionAction as action
join TicketInteraction as tkt
on action.TicketInteractionId=tkt.Id
join LoginDetails as logdet
on action.ActionTakenById=logdet.Id
join Executive as ex
on logdet.ExecutiveId=ex.Id
where ActionTakenByID=204
and action.TimeTaken<>'0.00'
)
select ExecutiveName,Date,Day,[dbo].[MinutesToHHMM](sum(ticketaction.TimeTaken )) as TotalTime from cte ct
join TicketInteractionAction ticketaction
on ticketaction.TicketInteractionId=ct.intid
where EntryDate is not null
and MONTH(ticketaction.EntryDate)=09
and YEAR(ticketaction.EntryDate)=2019
group by ExecutiveName,Date,Day
order by Date asc
Reply
Answers (
1
)
How to separate value exist on temp table dynamically separa
How to make join to teams display without join all teams ?