PDA

View Full Version : InfoNet SQL



Scott Leslie
January 28, 2016, 06:45 AM
Hi - I'm trying do use an SQL to interrogate CCTV survey data in Infonet 15.0. I want to get the sum the total surveyed lengths, for each CCTV operator, for each date. So for example, Operator A did 400m on 12/01/16, Operator B did 20m on 12/01/16.......

The following text is where I have got to, however my SQL skills area little rusty so I only get 1 surveyor per date when multiple crews have been out;

select (surveyed_by) AS 'Surveyed By',
SUM(surveyed_length) AS 'Surveyed Length (m)',
SUM(pipe.length) AS 'Pipe Length (m)'


group by
DATEPART(when_surveyed) AS 'Date'

If anyone can shed some light on this or post the code I should be using then it would be appreciated.
Thanks in advance,
Scott

Scott Leslie
January 28, 2016, 08:31 AM
This code gives me what I was after if anyone is interested:

select
count(*) AS 'Count',
SUM(surveyed_length) AS 'Length'


group by
DATEPART(when_surveyed) AS 'Date',(surveyed_by) AS 'Surveyor';