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
480
2.9k
198.2k
SQL statement for weekday
Apr 17 2018 11:59 AM
WEEKDAY problem...what i wrong?
Line 2 and line 3 error Weekday
SELECT a.id, a.redni_broj , a.radnik, isnull(convert(varchar(20), a.vrijemeodjave, 113),
''
) as vrijemeodjave, convert(varchar(20), b.vrijemeprijave, 113) as vrijemeprijave,
CASE WHEN WEEKDAY(b.vrijemeprijave) in (5,6) then 0
else
(CASE WHEN (DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) > 8 THEN 8 ELSE(DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) END) end AS radni_sati,
CASE WHEN WEEKDAY(a.vrijemeodjave) in (5,6) then 0
else
(CASE WHEN(DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) > 8 THEN(DATEDIFF(SECOND, b.vrijemeprijave, a.vrijemeodjave) / 3600) - 8 ELSE NULL END) end AS prekovremeni
FROM(SELECT id, redni_broj, radnik, vrijemeodjave, ROW_Number() OVER(Partition By id ORDER BY vrijemeprijave) as RowNum
FROM dbo.prijava_radnika) a INNER JOIN(SELECT id, redni_broj, radnik, vrijemeprijave, (ROW_Number() OVER(Partition By id ORDER BY vrijemeprijave) - 1) as RowNumMinusOne FROM dbo.prijava_radnika) b ON a.id = b.id where 1 = 1
Reply
Answers (
2
)
Connection contact lost while system going to sleep mode
how to stop audio after bootstarp close button in iframe