dbTalk Databases Forums  

MDX count number of past due days query

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss MDX count number of past due days query in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SAM
 
Posts: n/a

Default MDX count number of past due days query - 08-23-2006 , 08:43 AM






anyone knows how to translate this into MDX?

SELECT DATEDIFF(day, o.datecreated, getdate()) AS no_of_days_pastdue

I'm just counting the number of days since a invoice was created and I am
not sure how to do this in AS.



Has anyone follow this article?
http://blogs.conchango.com/christian...4/30/3901.aspx

I keep getting syntax errors. I am using AS 2000.

Reply With Quote
  #2  
Old   
SAM
 
Posts: n/a

Default RE: MDX count number of past due days query - 08-23-2006 , 10:55 AM






can anyone get this to work?

DATEDIFF("d", [Calendar].[Day], Now())

Not sure why I am getting unknown dimension for my calendar.

"SAM" wrote:

Quote:
anyone knows how to translate this into MDX?

SELECT DATEDIFF(day, o.datecreated, getdate()) AS no_of_days_pastdue

I'm just counting the number of days since a invoice was created and I am
not sure how to do this in AS.



Has anyone follow this article?
http://blogs.conchango.com/christian...4/30/3901.aspx

I keep getting syntax errors. I am using AS 2000.

Reply With Quote
  #3  
Old   
SAM
 
Posts: n/a

Default RE: MDX count number of past due days query - 08-23-2006 , 11:42 AM



This is what I have so far:

WITH MEMBER [Measures].[DaysPast] AS

'DATEDIFF("d",[Calendar].CurrentMember, date())'

SELECT {[Measures].[DaysPast], [Measures].[Amount Due]} on columns,
[Account Invoices].[Account Name].members on rows

FROM [Account Invoices History]

but I get an #error in the dayspast field.

"SAM" wrote:

Quote:
can anyone get this to work?

DATEDIFF("d", [Calendar].[Day], Now())

Not sure why I am getting unknown dimension for my calendar.

"SAM" wrote:

anyone knows how to translate this into MDX?

SELECT DATEDIFF(day, o.datecreated, getdate()) AS no_of_days_pastdue

I'm just counting the number of days since a invoice was created and I am
not sure how to do this in AS.



Has anyone follow this article?
http://blogs.conchango.com/christian...4/30/3901.aspx

I keep getting syntax errors. I am using AS 2000.

Reply With Quote
  #4  
Old   
SAM
 
Posts: n/a

Default RE: MDX count number of past due days query - 08-23-2006 , 01:31 PM



I am so frustrated with MDX, simple things are not simple.

Does anyone know why this would not work?

[Account Invoices].[Account Name].CurrentMember.Properties("Days Past")

"SAM" wrote:

Quote:
anyone knows how to translate this into MDX?

SELECT DATEDIFF(day, o.datecreated, getdate()) AS no_of_days_pastdue

I'm just counting the number of days since a invoice was created and I am
not sure how to do this in AS.



Has anyone follow this article?
http://blogs.conchango.com/christian...4/30/3901.aspx

I keep getting syntax errors. I am using AS 2000.

Reply With Quote
  #5  
Old   
SAM
 
Posts: n/a

Default RE: MDX count number of past due days query - 08-23-2006 , 01:35 PM



I got it to work but unfortunately it is not what I need. I need it to be
dynamic.

Help, does anyone know how to get datediff to work in AS 2000?


"SAM" wrote:

Quote:
anyone knows how to translate this into MDX?

SELECT DATEDIFF(day, o.datecreated, getdate()) AS no_of_days_pastdue

I'm just counting the number of days since a invoice was created and I am
not sure how to do this in AS.



Has anyone follow this article?
http://blogs.conchango.com/christian...4/30/3901.aspx

I keep getting syntax errors. I am using AS 2000.

Reply With Quote
  #6  
Old   
yongli
 
Posts: n/a

Default RE: MDX count number of past due days query - 08-25-2006 , 05:16 PM



Sam, [Calendar].currentMember probably is not in the date format, you need to
convert to date format. If the name for the member is already in date format,
you should use [Calendar].currentmember.name, hope this helps.

"SAM" wrote:

Quote:
This is what I have so far:

WITH MEMBER [Measures].[DaysPast] AS

'DATEDIFF("d",[Calendar].CurrentMember, date())'

SELECT {[Measures].[DaysPast], [Measures].[Amount Due]} on columns,
[Account Invoices].[Account Name].members on rows

FROM [Account Invoices History]

but I get an #error in the dayspast field.

"SAM" wrote:

can anyone get this to work?

DATEDIFF("d", [Calendar].[Day], Now())

Not sure why I am getting unknown dimension for my calendar.

"SAM" wrote:

anyone knows how to translate this into MDX?

SELECT DATEDIFF(day, o.datecreated, getdate()) AS no_of_days_pastdue

I'm just counting the number of days since a invoice was created and I am
not sure how to do this in AS.



Has anyone follow this article?
http://blogs.conchango.com/christian...4/30/3901.aspx

I keep getting syntax errors. I am using AS 2000.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.