Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MDX count number of past due days query

15 views
Skip to first unread message

SAM

unread,
Aug 23, 2006, 9:43:02 AM8/23/06
to
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/christianwade/archive/2006/04/30/3901.aspx

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

SAM

unread,
Aug 23, 2006, 11:55:03 AM8/23/06
to
can anyone get this to work?

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

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

SAM

unread,
Aug 23, 2006, 12:42:01 PM8/23/06
to
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

unread,
Aug 23, 2006, 2:31:01 PM8/23/06
to
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

unread,
Aug 23, 2006, 2:35:01 PM8/23/06
to
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?

yongli

unread,
Aug 25, 2006, 6:16:03 PM8/25/06
to
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.
0 new messages