We help IT Professionals succeed at work.

SQL Timeout Error

Murray Brown
Murray Brown asked
on
63 Views
Last Modified: 2018-12-12
Hi

If I run the following query I get a timeout error with [Shaft] = 'tshepong air' but with any other Shaft eg [Shaft] = 'kopanang air' I get no error even where there is a lot more data.

What could cause this?

Select [COY],Sum([M Shift]) As [M Shift], Sum([N Shift]) As [N Shift], Sum([Sick]) As [Sick],  Sum([AWOP]) As [AWOP], Sum([Leave]) As [Leave], Sum([Comp Leave]) As [Comp Leave], Sum([5 Sat Day]) As [5 Sat Day], Sum([5 Sat Night]) As [5 Sat Night], Sum([6 Sat Day]) As [6 Sat Day], Sum([6 Sat Night]) As [6 Sat Night] , Sum([PPH]) As [PPH], Sum([Shift Worked In Day]) As [Shift Worked In Day], Sum([Shift Worked In Night]) As [Shift Worked In Night], Sum([Lesedi Training]) As [Lesedi Training], Sum([Mine Training]) As [Mine Training], Sum([IOD]) As [IOD] From [vTimesheets] Where [Day] >= '2018-11-16' And [Day] <='2018-11-30' And [Shaft] = 'tshepong air' Group By [COY]

Open in new window

Comment
Watch Question

Senior Software Developer
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Thanks very much for the help. Sorry abut the late reply