MYSQL Select Count if greater than 0

Is there a way i can count all the greater than 0 in late?

Select *, timestampdiff(minute, t1.startTime, t.IOTime) as late from tbl_time GROUP BY name

if the late returns higher than 0 then it should count.

Select *, COUNT(timestampdiff(minute, t1.startTime, t.IOTime)) as late from tbl_time

but I don’t know how to make it’s condition

example of my data:

tbl_time
name     IOTime  Date
Chris    9:50    2015-02-11
Chris    9:30    2015-02-12
Chris    9:20    2015-02-13

in other table is where the startTime

name     startTime
Chris    9:25

So in timestamp it returns how many minutes he’s late I would like to have a return value that counts all the timestamp that return greater than 0 so i can count all his total late

name    total_late
Chris   2


Download mysql.select.count.if.greater.than.0.zip
Direct Link


Download


Download mysql.select.count.if.greater.than.0.zip
Mediafire


Download


Download mysql.select.count.if.greater.than.0.zip
4Shared


Download


Download mysql.select.count.if.greater.than.0.zip
Unlimitzone


Download


Download mysql.select.count.if.greater.than.0.zip
Secureupload


Download

Both comments and pings are currently closed.

Comments are closed.