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-13 : 05:08:43
|
| HiCan someone help me with following problem: i have 2 collums, the one is with 1 and 0, these mean : if it is a 1 its a permanent product, if it is 0 its a trial version.When it is 0 we have the second collum and in that collum the expiration date is in it.Now i need a TSQL that tells me in a new collum, when i link it to my time dimension. That in 30 days that product is going to expire. I tried alot of possibilitys, but i dont get the right data Thanks in advance |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-13 : 05:10:47
|
SELECT * FROM Table1WHERE Col1 = 1 OR Col2 >= GETDATE() AND Col2 < DATEADD(DAY, 30, GETDATE()) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-03-13 : 05:18:01
|
| And I thank you very much :) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-03-13 : 05:52:03
|
SELECT * FROM Table1WHERE Col1 = 1OR Col2 BETWEEN GETDATE() AND DATEADD(DAY, 30, GETDATE()) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
IBoonZ
Yak Posting Veteran
53 Posts |
Posted - 2009-03-13 : 06:23:46
|
| Is there a possibility to create these values in a new collumn? Cus when i try to link them to myfact table, i get an error, because the where function ingores the trial versions that are older then 30 days.Or do you have a better solution?Kind Regards |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|
|
|