Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I have the following:SELECT ExplorerSnapshot.SignerLastName, ExplorerSnapshot.SignerFirstName,ExplorerSnapshot.DictatorLastName, ExplorerSnapshot.DictatorFirstName,"dbo"."Order".CreateDate, "dbo"."Order".CompleteDate, Report.BeginEditDate, Report.LastPrelimDate,Report.LastSignDate, Report.IsAddendumFROM "dbo"."Order", ExplorerSnapshot, ReportWHERE Report.ReportID = "dbo"."Order".ReportIDAND ExplorerSnapshot.ReportID = "dbo"."Order".ReportIDAND ExplorerSnapshot.OrderDate BETWEEN '12/15/2012' and '12/18/2012';My goal is to have:Report.LastSignDate subtract from Report.LastPrelimDate and give minutesReport.LastPrelimDate subtract from Report.BeginEditDate and give minutesReport.BeginEditDate subtract from "dbo"."Order".CompleteDate and give minutes"dbo"."Order".CompleteDate subtract from "dbo"."Order".CreateDate and give minutesIs that possible?
THANK YOU!!!!! You're a genius and it worked!!!! Of all the hours of googling and I got nothing that worked. Yours worked! THANKS!!!!
uneek78
Starting Member
13 Posts
Posted - 2012-12-18 : 16:29:57
Soooooooooooooooooo(lol) how could I give each of those columns a specific name?
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts
Posted - 2012-12-18 : 19:51:57
Give each one an alias:[CODE]DATEDIFF(minute, Report.LastPrelimDate, Report.LastSignDate) as MinutesToSign,DATEDIFF(minute, Report.LastPrelimDate, Report.BeginEditDate) as MinutesTostart[/CODE]=================================================Hear the sledges with the bells - silver bells! What a world of merriment their melody foretells!
uneek78
Starting Member
13 Posts
Posted - 2012-12-19 : 09:48:25
Aaaaaah..........much appreciated my friend.
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2012-12-19 : 09:55:44
quote:Originally posted by uneek78 Aaaaaah..........much appreciated my friend.