together ?
(select count (*) as ontime from schedule where actualarrivaldate <=
estimatearrivaldate)
(select count (*) as total from schedule)
Thanks for any help
RobertSELECT ontime, total, ontime/CAST(total AS REAL)
FROM
(SELECT COUNT(CASE WHEN actualarrivaldate <= estimatearrivaldate
THEN 1 END), COUNT(*)
FROM schedule) AS X(ontime,total)
(untested)
--
David Portas
----
Please reply only to the newsgroup
--|||Thanks for the quick reply, the query worked perfect.
Cheers
Robert
"David Portas" <REMOVE_BEFORE_REPLYING_dportas@.acm.org> wrote in message
news:nMadnd4h2ZNOrveiRVn-hw@.giganews.com...
> SELECT ontime, total, ontime/CAST(total AS REAL)
> FROM
> (SELECT COUNT(CASE WHEN actualarrivaldate <= estimatearrivaldate
> THEN 1 END), COUNT(*)
> FROM schedule) AS X(ontime,total)
> (untested)
> --
> David Portas
> ----
> Please reply only to the newsgroup
> --
No comments:
Post a Comment