Hi I'm using ms sql 2005.I created a view where I retrive PriceDate's from 2 tables. However If the priceDate is NULL, I'd like to put the Last PriceDate that comes from the Query. Here is the my view so far;SELECT TOP (100) PERCENT G.OwningPortfolioID, CI.Description, CI.SecurityID, CI.SecurityTypeID, CI.TQuantity, CI.Amount, CI.PriceDateFROM dbo.CurrentInvestment AS CI WITH (Nolock) INNER JOIN dbo.Groups AS G WITH (Nolock) ON CI.PortfolioID = G.PortfolioIDWHERE (CI.TQuantity > 0.000001) AND (G.OwningPortfolioID = 270)ORDER BY CI.PortfolioID, CI.PriceDate DESC
I tried using Case function, but no luck. Any help would greatly appreciated. Thanks.