---
title: "分段计算时间的值"
author: "cab0605"
date: "2011-04-26T23:03:38Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2011-04-26T23:03:38Z"
id: 1019024
url: "https://cab0605.iteye.com/blog/1019024"
---

时间计算

select CAST(  
DATEDIFF(Mi,CONVERT(datetime, experBeginTime, 120),  
CONVERT(datetime, experFinishTime, 120))/1440.00 as long) as da,  
\*  
from dbo.experName