两个时间之间的差异,结果可用于if条件 [英] difference between two timings and the result can be used in if condition

查看:110
本文介绍了两个时间之间的差异,结果可用于if条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮我找出两个时间之间的差异,结果可以用在

如果条件

ie,diff = 08:00:00

Can any one help me to find out the difference between two timings and the result can be used in
if condition
i.e.,diff= 08:00:00

if(diff= 08:00:00)
Set status = 'p'
else
set status ='A'
    &
inpunch= NULL,Outpunch = NULL

如果我想要的话为了更新它没有执行的状态,任何人都可以帮助我为什么会这样。





我想通过考虑更新状态在& out punches

例如:inpunch = 08:00:00

outpuncnch = 12:00:00

状态为'HL'



以类似的方式保留我们正在考虑的出勤目的

here if i want to update the status it is not executing can any one help me why it was happened.


I want to update the status by considering the in & out punches
eg: inpunch = 08:00:00
outpuncnch = 12:00:00
status as 'HL'

remaining in a similar manner what we are caluculating for attendance purpose

推荐答案

尝试这样的事情:

Try something like that:
IF DATEDIFF(hh, @starttime, @endtime) = 8
BEGIN
    --true part
END
ELSE
BEGIN
    --false part
END





如需了解更多信息,请参阅:

日期 [ ^ ]

IF ... ELSE [ ^ ]


这篇关于两个时间之间的差异,结果可用于if条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆