欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

Sql: 請假跨月份問題,或跨年份問題 日期部分边界

程序员文章站 2024-04-02 19:40:04
...

,,,,((ss, @sart , @end ) (( @end )) ((( @end ) month ( @sart )) (((((( DATEPART (second, @sart ) as varchar ) ( ) (( day , @sart ) + 1 , @sart ))) (((((( DATEPART (second, @end ) as varchar ) ( ) (, @end )) ,(ms,, GETDATE ()) ()) ()())) ()

,,,,((ss,@sart,@end) ((@end)) (((@end)>month(@sart)) ((((((DATEPART(second,@sart) as varchar) ( ) ((day, @sart)+1,@sart ))) ((((((DATEPART(second,@end) as varchar) ( ) (,@end)) ,(ms,,GETDATE()) ()) ()())) ())())) -- , 49 Days = datediff(dd,0,DateDif), 50 Hours = datepart(hour,DateDif), 51 Minutes = datepart(minute,DateDif), 52 Seconds = datepart(second,DateDif), 53 MS = datepart(ms,DateDif) ( DateDif = EndDate-StartDate, ( StartDate ), ) 64 ) aa 65 ) a ,服务器空间,美国服务器,香港服务器