Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calc Time query
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Miscellaneous
Thread ID:
00594564
Message ID:
00594649
Views:
31
Something like this:

SELECT
(SELECT DATEDIFF(minute, begintime, endtime FROM table t2 WHERE blockmember=1 AND t2.blockid = table.blockid) / DATEDIFF(minute, begintime, endtime)
FROM
table
WHERE
isblock = 1

This could be rewritten without the subquery.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Reply
Map
View

Click here to load this message in the networking platform