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
Goran Bibic
482
2.9k
197.9k
Select from sql table MONTh sum
May 20 2018 6:46 AM
My code working fine for all table records....i need to specified record for mont from combobox
SELECT [radnik] as Radnik,
SUM (cast((CASE WHEN DATEPART(WEEKDAY, vrijemeprijave) in (1,7) then 0
else
(CASE WHEN (DATEDIFF(SECOND, vrijemeprijave, vrijemeodjave) / 3600) > 8 THEN 8 ELSE(DATEDIFF(SECOND, vrijemeprijave, vrijemeodjave) / 3600) END) end)as
float
)) AS
'Radni sati'
,
SUM (cast((CASE WHEN DATEPART(WEEKDAY, vrijemeodjave) in (1,7) then (DATEDIFF(SECOND, vrijemeprijave, vrijemeodjave) / 3600)
else
(
case
when(DATEDIFF(SECOND, vrijemeprijave, vrijemeodjave) / 3600) > 8 then ((DATEDIFF(SECOND, vrijemeprijave, vrijemeodjave) / 3600)-8) ELSE 0 END) end)as
float
)) AS
'Prekovremeni'
from [prijava_radnika]
group by [radnik]
Some help?
Reply
Answers (
7
)
How to send email using trigger. When new Data is inserted?
Data Dictionary for a database