Viewing 3 posts - 1 through 3 (of 3 total)
What about using a status field in the fact table?
The status field should be part of the key and has three values, according to your scheme.
Actual records have status 'actual'....
August 6, 2008 at 6:46 am
#853764
You should write a conditional select statement then:
declare @Cnt int
SELECT @Cnt = count(CName) FROM [TableName] where CName= 850891144
select TVolume=
case @cnt
when 0 then
...
August 6, 2008 at 6:18 am
#853746
You declared the variable as type varchar, but the select statement returns a numeric value (because you use the count function).
Declaring the variable as type int should solve your problem.
August 5, 2008 at 8:42 am
#853222