I have to hand code a query, i have called it Rain_Data.
This is the main part of the query.
SELECT DATEVALUE(Time), Seconds, (Select TOP 1 Seconds FROM tblImportTableTest) / 3600 as hourFrac,
CDEC(testa, 7) as A, CDEC(testb, 7) as B, CDEC(testc, 7) as C, CDEC(testd, 7) as D,
CDEC(teste, 7) as E, CDEC(testf, 7) as F, CDEC(testg, 7) as G, CDEC(testh, 7) as H
FROM tblImportTableTest
I inserted the above code into the query code builder.
--------------------------------------------------------
-- My queries
--------------------------------------------------------
1. Number of spill timesteps >0.001
Select count(Seconds) AS CT FROM Rain_Data WHERE
A > 0.001
OR B > 0.001
OR C > 0.001
OR D > 0.001
OR E > 0.001
OR F > 0.001
OR G > 0.001
OR H > 0.001
2. Total number of timesteps
SELECT COUNT(Seconds) from Rain_Data
3. Spill timesteps as a % of total timesteps
-- I'm assuming that a spill is greater than 0.001
SELECT TOP 1
((
Select count(Seconds) AS CT FROM Rain_Data WHERE
A > 0.001
OR B > 0.001
OR C > 0.001
OR D > 0.001
OR E > 0.001
OR F > 0.001
OR G > 0.001
OR H > 0.001
) /
(
SELECT COUNT(Seconds) from Rain_Data
)) * 100 AS PCentSpills FROM Rain_Data
Where about do i put the above queries??
This is the main part of the query.
SELECT DATEVALUE(Time), Seconds, (Select TOP 1 Seconds FROM tblImportTableTest) / 3600 as hourFrac,
CDEC(testa, 7) as A, CDEC(testb, 7) as B, CDEC(testc, 7) as C, CDEC(testd, 7) as D,
CDEC(teste, 7) as E, CDEC(testf, 7) as F, CDEC(testg, 7) as G, CDEC(testh, 7) as H
FROM tblImportTableTest
I inserted the above code into the query code builder.
--------------------------------------------------------
-- My queries
--------------------------------------------------------
1. Number of spill timesteps >0.001
Select count(Seconds) AS CT FROM Rain_Data WHERE
A > 0.001
OR B > 0.001
OR C > 0.001
OR D > 0.001
OR E > 0.001
OR F > 0.001
OR G > 0.001
OR H > 0.001
2. Total number of timesteps
SELECT COUNT(Seconds) from Rain_Data
3. Spill timesteps as a % of total timesteps
-- I'm assuming that a spill is greater than 0.001
SELECT TOP 1
((
Select count(Seconds) AS CT FROM Rain_Data WHERE
A > 0.001
OR B > 0.001
OR C > 0.001
OR D > 0.001
OR E > 0.001
OR F > 0.001
OR G > 0.001
OR H > 0.001
) /
(
SELECT COUNT(Seconds) from Rain_Data
)) * 100 AS PCentSpills FROM Rain_Data
Where about do i put the above queries??