我想计算两个日期之间的日子减法 [英] i want to count days between 2 dates substraction
本文介绍了我想计算两个日期之间的日子减法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
2个日期列存储在表中如何获取和减去该数并计算总天数
2 dates column is storing in table how can i fetch and substract that and count total days
推荐答案
使用SQL ServerDateDiff
功能 [ ^ ]。
EgSELECT DATEDIFF(day,date1,date2')AS DiffDate
Use the SQL ServerDateDiff
function[^].
E.g.SELECT DATEDIFF(day,date1,date2') AS DiffDate
试试这个
try this
select DATEDIFF(day,date1,date2) as dDiff from table
这篇关于我想计算两个日期之间的日子减法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文