Viewing 8 posts - 1 through 9 (of 9 total)
Calc1 would be f.ForecastValue and Calc2 would be d.DeliveryValue
June 15, 2007 at 9:10 am
Point taken....
Thx a lot guys, I having a bit of a struggle on this one.
CREATE TABLE [MeasurementLog] (
[MeasurementLogID] [int] IDENTITY (1, 1) NOT NULL ,
[MeasurementLogTimeStamp] [datetime] NOT NULL CONSTRAINT [DF_MeasurementLog_MeasurementLogTimeStamp]...
June 11, 2007 at 5:37 am
Thx for trying to help!
I did actually exactly what you did (did not submit it to see you you guys did't in a diffrent way) and that works great for the...
June 11, 2007 at 4:53 am
oh sorry...
So when ml.MeasurementLogValue is NULL then I want to take the last value that is not NULL from ml.MeasurementLogValue and substract f.forecastValue and add d.deliveryValue, if more rows have...
June 11, 2007 at 3:11 am
Here it comes..
SELECT f.TankObjectID,
f.ForecastDate,
f.ForecastValue,
Case
when ml.MeasurementLogValue IS NOT NULL then
ml.MeasurementLogValue
Else
"Here's where I need the logic to preform that calculation"
End MeasurementLogValue,
d.DeliveryValue,
f.CustomerReference,
d.SupplierReference
FROM...
June 11, 2007 at 3:02 am
Hi agin,
That far I did get as well, that biggest problem for me that I don't find a good approach to the last isuue e.g. per my first example on the...
June 11, 2007 at 2:35 am
Thx, but I think I need a bit more pointers to head me in the right direction...
The actual query without an attempt to fix the null issue.
SELECT f.TankObjectID,
f.ForecastDate,
f.ForecastValue,
ml.MeasurementLogValue,
d.DeliveryValue,
f.CustomerReference,
d.SupplierReference
FROM dbo.Forecast f
LEFT...
June 11, 2007 at 2:10 am
ok, sorry guys for the lack of info, here you go..
Expected result:
Date LoggedValue Calc1 Calc2
2007-06-11 '200' 100 200
2007-06-12 '300' 100 0
2007-06-13 '200' 100 300
So here's how is should...
June 11, 2007 at 12:40 am
Viewing 8 posts - 1 through 9 (of 9 total)