Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 DateDiff question

Author  Topic 

JeffS23
Posting Yak Master

212 Posts

Posted - 2007-04-16 : 12:14:17
I would like to do a DateDiff between the [StrtHour + StrtMin] minus [StpHour + StpMin] - into minutes. Is it possible to take 4 fields like so and do a datediff on it? If so, can someone please post the code?

StrtHour=convert(varchar(2),datepart(hour,a.ApptStart)),
StrtMin=convert(varchar(2),datepart(minute,a.ApptStart)),
StpHour=convert(varchar(2),datepart(hour,a.ApptStop)),
StpMin=convert(varchar(2),datepart(minute,a.ApptStop)),


khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-04-16 : 12:19:37
[code]
select datediff(minute, ApptStart, ApptStop)
[/code]


KH

Go to Top of Page
   

- Advertisement -