zoukankan      html  css  js  c++  java
  • 通过时间相差的分钟数,得出加班半小时,1小时,1.5不时,2小时等..

    ALTER  function   [dbo].[GetHour](@dt1 datetime,@dt2 datetime)
      returns  varchar(30)
      as    
      begin  
       declare   @ch   as   varchar(30)  
       declare   @mins as int   
       select @mins =(SELECT datediff( MINUTE, @dt1 , @dt2))   
        if   @mins>= 30 and @mins< 60   
           begin  
            set @ch = '0.5 H'
           end  
        else if  @mins>= 60 and @mins<90   
            begin  
            set @ch = '1 H'
           end
        else if @mins>= 90 and @mins<120    
            begin  
            set @ch = '1.5 H'
           end    
        else if @mins>= 120 and @mins<150    
            begin  
            set @ch = '2 H'
           end       
        else if @mins>= 150 and @mins<180    
            begin  
            set @ch = '2.5 H'
           end 
        else if @mins>= 180 and @mins<210    
            begin  
            set @ch = '3 H'
           end 
       else if @mins>= 210 and @mins<240    
            begin  
            set @ch = '3.5 H'
           end
       else if @mins>= 240 and @mins<270    
            begin  
            set @ch = '4 H'
           end
       else if @mins>= 270 and @mins<300    
            begin  
            set @ch = '4.5 H'
           end
       else if @mins>= 300 and @mins<330    
            begin  
            set @ch = '5 H'
           end 
      else     
            begin  
            set @ch = @mins
           end 
       return @ch
      end
     
     

  • 相关阅读:
    Java中用Apache POI生成excel和word文档
    openlayers实现画圆
    openlayers实现wfs属性查询和空间查询
    jquery自定义控件拖拽框dragbox
    基于openlayers实现聚类统计展示
    openlayers实现在线编辑
    openlayers之selectfeature
    J
    HDU-1051Wooden Sticks
    HDU-1087Super Jumping! Jumping! Jumping!
  • 原文地址:https://www.cnblogs.com/szlixin/p/4335433.html
Copyright © 2011-2022 走看看