AnsweredAssumed Answered

Using SQL to find empty time

Question asked by MikeWile on Nov 14, 2018
Latest reply on Nov 15, 2018 by beverly

I have a table TaskTIME that has records for employee time. I'm trying to use ExecuteSQL to get a count of any times for the month of the record where there is Time of less than 1 minute. So, for November of this year, I want a count of records for 11/1/2018 to 11/30/2018 where the Taskcode = "PRDDEV" and the time is less than 1 minute. The table contains fields including Staff_ID fk, Date, and Taskcode. I've tried

 

Let([

~start=Date(Month(TaskTIME::Date);1;Year(TaskTIME::Date));

~end=Date(Month(TaskTIME::Date)+1;0;Year(TaskTIME::Date));

~task="PRDDEV"];

ExecuteSQL ( "SELECT COUNT \"Staff_ID fk\"

FROM \"TaskTIME\"

WHERE \"Taskcode\" = ?

AND \"Date\" BETWEEN ? AND ?

AND \"Time\" <1 "

;"";"";~task;~start;~end)

)

 

but something is not right. Any ideas? Thanks.

 

I should also mention that quite often the Time field is empty when they forget to enter time.

Outcomes