|
Posted by David Portas on 09/29/05 21:01
> create table a
> (account int
> ,balance_date datetime
> ,balance money)
Why are all your columns nullable? What is/are the key/s of this table?
Are you aware that MONEY will give you imprecisely rounded results when
you multiply or divide?
Try:
SELECT account, balance_date, balance
FROM a AS T
WHERE balance_date =
(SELECT MAX(balance_date)
FROM a
WHERE account = T.account) ;
--
David Portas
SQL Server MVP
--
Navigation:
[Reply to this message]
|