MySQL Query doesn't work but works some time, whats wrong with it? Below Query doesn't work most of the time and giving error Getting error #1048 - Column 'StateStarttime' cannot be null but work sometimes, what am I doing wrong here 

I think DATE_FORMAT( NOW()-60 , '%H:%i' ) causing the issue if it is what will be the right syntax?

INSERT INTO time ( 
EmpID, 
Date, 
Username, 
Computername, 
State, 
MinutesatState, 
StateStarttime, 
StateEndtime 
) VALUES ( 
'303016', 
CURDATE(), 
'yatendra', 
'NIPL885', 
'Active', 
'1', 
DATE_FORMAT( NOW()-60 , '%H:%i' ), 
DATE_FORMAT( NOW() , '%H:%i' ) 
)
NOW() in number context is treated as de-delimitered textual datetime in short format (see Conversion Between Date and Time Types, the last demo). So substraction can cause invalid datetime value.

To obtain correct result perform calculations in datetime context. The best (and simplest) way is to use

NOW() - INTERVAL 60 SECOND


or use some datetime function.