Hi all, hope all is well. Im putting together a new database to work out passes and fails an hour and resultant percentage yield and i've got a couple of quandaries just now im hoping someone more enlightened can pick up. The code seems to work and produce the desired results, but if i try to edit in sql view i get the error....Syntax error in string in query expression '00\:00'))'. I tried running through a sql validator and sure enough got an error..
You have an error in your SQL syntax; it seems the error is around: '[field1], '00\:00\:00')) AS [Hour], ( SELECT COUNT(*) FROM ' at line 2. The code as said previous works functionally but seems to have an error in formatting. Any help would be appreciated.
You have an error in your SQL syntax; it seems the error is around: '[field1], '00\:00\:00')) AS [Hour], ( SELECT COUNT(*) FROM ' at line 2. The code as said previous works functionally but seems to have an error in formatting. Any help would be appreciated.
Code:
SELECT
Val(Format([field1], '00\:00\:00')) AS [Hour],
(
SELECT
COUNT(*)
FROM
Timer1 AS T1
WHERE
Val(Format(T1.[field1], '00\:00\:00')) = Val(Format(Timer1.[field1], '00\:00\:00'))
AND T1.Field3 Like 'pass'
AND T1.datein Between (
Date() + #8:00:00 AM#) And (Date()+#11:59:00 PM#)) AS Pass,(
SELECT
COUNT(*)
FROM
Timer1 AS T1
WHERE
Val(Format(T1.[field1], '00\:00\:00')) = Val(Format(timer1.[field1], '00\:00\:00'))
AND T1.Field3 Like 'fail'
AND T1.datein Between (
Date() + #8:00:00 AM#) And (Date()+#11:59:00 PM#)) AS fail, IIf(([fail] + [pass]) = 0, 0, Round(([pass] / ([fail] + [pass])) * 100, 2)) AS yield
FROM
timer1
GROUP BY
Val(Format([field1], '00\:00\:00'));