Viewing 4 posts - 1 through 4 (of 4 total)
Lowell,
I guess it should be like this:
SELECT p.*, COALESCE(s.SalePrice, p.SalePrice) AS Price, COALESCE(s.SaleCost, p.SaleCost) AS Cost
FROM [#PROMO] p
LEFT JOIN [#sh] s
ON s.ClientOutletID = p.ClientOutletID
AND s.ClientProductID = p.ClientProductID
...
September 28, 2007 at 1:54 am
This is how I was able to do that :).
set nocount on
Create table #PromoHistory
(
WeekDate datetime NOT NULL, OutletId nvarchar(50) NOT NULL, ProductId nvarchar(50) NOT NULL,Price decimal(18,2) NOT NULL,Cost decimal(18,2) NOT...
September 25, 2007 at 3:10 pm
No. Actually I was missing brackets that is exec(@sql) .
I made the changes and it worked for the first example.
But for example2 its giving the following erorr:
Server: Msg 137,...
September 25, 2007 at 5:09 am
Steve,
I am not a SQL expert. Please guide me how I can achieve this. First of all do you fully understand the problem?
I have created a script to create a...
September 24, 2007 at 11:12 am
Viewing 4 posts - 1 through 4 (of 4 total)