考勤日报表中的 考勤的时间一般都是:2010-07-03 07:30:000 的格式请问怎样能把 下班OUT3 的时间是 07:30 所有日期等于07:30:00这个时间查找出来

解决方案 »

  1.   

    where datepart(hh,getdate())=7 and datepart(mi,getdate())=30
      

  2.   

    select * from tablename 
    where datepart(hh,datefield)=7 and datepart(mi,datefield30
      

  3.   

    select * from tablename 
    where datepart(hh,datefield)=7 and datepart(mi,datefield)=30
      

  4.   

    select CONVERT(varchar(100), GETDATE(), 24)
    16:08:31
      

  5.   

    SELECT CASE WHEN CAST(CONVERT(VARCHAR(8),GETDATE(),108) AS DATETIME) = '7:30' THEN 1 ELSE 0 END SELECT CASE WHEN DATEPART(hh,GETDATE())*60+DATEPART(mm,GETDATE()) = 7*60+30 THEN 1 ELSE 0 END
      

  6.   

    这条语句再把下班时间3 OUT3等于 07:30 时间的条件找出来,请问加什么条件进去?select * from KQ_DateReport where  iodate>='2010-08-01' and iccardid='0008215657'
      

  7.   


    select * from KQ_DateReport where iodate>='2010-08-01' and iccardid='0008215657'
    and datepart(hh,iodate)=7 and datepart(mi,iodate)=30
      

  8.   

    执行之后什么都没有,也没有错误提示还是是下面时间3 即OUT3的所有时间是07:30这个时间查询出来
      

  9.   


    select * from KQ_DateReport where iccardid='0008215657'
    and ( iodate>='2010-08-01' and  datepart(hh,iodate)=7 and datepart(mi,iodate)=30)
      

  10.   


    什么也没有代表没有满足条件的记录啊~我知道为什么没记录了,SQL应该是下面这样的
    select * from KQ_DateReport where iodate>='2010-08-01' and iccardid='0008215657'
    and datepart(hh,OUT3)=7 and datepart(mi,OUT3)=30是OUT3的时间是07:30,不是iodate的时间为07:30。囧啊~~~审题不清~~~
      

  11.   

    应该是iodate>='2010-08-01'这个的问题
      

  12.   

     SELECT CONVERT(VARCHAR(6),CONVERT(DATETIME,'2010-07-03 07:30:10.000'), 108)+'00'