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.
| Author |
Topic |
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-03-16 : 05:58:23
|
| hiSorry 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 followedIS_PERMANENT / VALID AFTER / VALID UNTIL 1 / 2007-01-14 / NULL1 / 2007-03-12 / NULL0 / 2007-01-28 / 2007 -05 - 250 / 2007-03-19 / 2007-07-23....IS_PERMANENT = 1 = NO trial version / 0 = TRIAL VERSIONNow, this table is already linked to my fact table.But i need a new collumn in my fact table that shows my productsthat 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... |
 |
|
|
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! |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-03-16 : 07:32:34
|
| i dident know the case thingie :). he, sry |
 |
|
|
|
|
|