Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Fact measure, show products that finish in 30 days

Author  Topic 

IBoonZ
Yak Posting Veteran

53 Posts

Posted - 2009-03-16 : 05:58:23
hi

Sorry for the subject, but i dident know how to define it.
My problem is as followed.
I am making a cube and now i need a measure of trial products or not.
The data is as followed

IS_PERMANENT / VALID AFTER / VALID UNTIL

1 / 2007-01-14 / NULL
1 / 2007-03-12 / NULL
0 / 2007-01-28 / 2007 -05 - 25
0 / 2007-03-19 / 2007-07-23
....


IS_PERMANENT = 1 = NO trial version / 0 = TRIAL VERSION

Now, this table is already linked to my fact table.
But i need a new collumn in my fact table that shows my products
that are going to expire within 30 days.
Or another method. The thing i need is a fact that shows me what products are going to expire in 30 days.

Hope the info i showed here is usefull.

Thanks :)

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-03-16 : 06:27:33
you can add a column there ..


Select
....
case when [VALID AFTER] between getdate() and getdate()+30 then 'Expires in 30 Days' else '-' end From
...
Where
...
Go to Top of Page

IBoonZ
Yak Posting Veteran

53 Posts

Posted - 2009-03-16 : 07:08:30
The solution is so simple, but to find it, thats something else :).
Thx Sakets!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-16 : 07:19:13
Same solution as this topic
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=121603



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

IBoonZ
Yak Posting Veteran

53 Posts

Posted - 2009-03-16 : 07:32:34
i dident know the case thingie :). he, sry
Go to Top of Page
   

- Advertisement -