Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

need MDX query to find something like date diff and Date Range for last 10 days

$
0
0

Hi ,

I need two Query .First Query for below;

I have below data in table like.

Cat      StartDate    EndDate     
A    2000-01-01     2000-01-15   
B    2000-01-02     2000-01-30    
C    2000-01-01     2000-01-31    
D    2000-02-01     2000-02-28    
A    2000-01-10     2000-01-31    


I need if Startdate and Date completes whole one month then set status =1 else  0 using MDX query.

like this ;

Cat      StartDate    EndDate       Status
A    2000-01-01     2000-01-15    1
B    2000-01-02     2000-01-30    0
C    2000-01-01     2000-01-31    1
D    2000-02-01     2000-02-28    1
A    2000-01-10     2000-01-31    1


In second query I need last 10 days from current days like;

Now = 8/20/2014

output will be ;

8/20/2014
8/19/2014
8/18/2014
8/17/2014
8/16/2014
8/15/2014
8/14/2014
8/13/2014
8/12/2014
8/11/2014
8/10/2014


Please help me .

Thanks


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>