dbTalk Databases Forums  

AS 2005 date() function

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


Discuss AS 2005 date() function in the microsoft.public.sqlserver.olap forum.



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

Default AS 2005 date() function - 04-24-2006 , 06:56 PM






Hi all,

I have a lot of MDX queries that worked OK on AS 2000. I recently started
migrating to AS2005 but queries that have date() function doesn't work.

AS installed these assemblies:
System, VBAMDXInternal, VBAMDX and ExcelMDX.

By the way, I am using Analysis Services 2005 with SP1.

Thanks everybody,

Andrés





Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: AS 2005 date() function - 04-25-2006 , 12:17 AM






Hi Andrés,

You're right, the Date() function doesn't work for me in AS 2005
Adventure Works - but Now() still seems to work. So could you use
something like:

Quote:
With Member [Measures].[Today] as
Format(Now(), "d")
select {[Measures].[Today]} on 0
from [Adventure Works]
---------------------------------
Today
4/25/2006
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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

Default Re: AS 2005 date() function - 04-25-2006 , 02:37 PM



Hi Deepak

Yes. It works. But we have a lot of DTS, Scripts and Reports that depend on
date() function. Which library has the date() function?
Its possible to register the old DLL?

Regards,

Andrés



"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Hi Andrés,

You're right, the Date() function doesn't work for me in AS 2005
Adventure Works - but Now() still seems to work. So could you use
something like:


With Member [Measures].[Today] as
Format(Now(), "d")
select {[Measures].[Today]} on 0
from [Adventure Works]
---------------------------------
Today
4/25/2006



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***



Reply With Quote
  #4  
Old   
Deepak Puri
 
Posts: n/a

Default Re: AS 2005 date() function - 04-25-2006 , 06:17 PM



Andrés,

I checked the list of VBA functions exported by the VBAMDX assembly
(this is outlined on page 363 of the Applied MSAS 2005 book by Teo
Lachev), and Date() is still there. So the problem is probably due to a
collision with the reserved usage of Date elsewhere - this also happened
with Log().

Enclosing "Date" in square brackets resolves this issue:

Quote:
With Member [Measures].[Today] as
CStr(VBA![Date]())
select {[Measures].[Today]} on 0
from [Adventure Works]
---------------------------------
Today
4/25/2006
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***


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

Default Re: AS 2005 date() function - 04-27-2006 , 10:40 AM



Yes.

However, if we have to change all to Vba![date()] I think we should change
everything to Now().

Thanks a lot!

Andrés




"Deepak Puri" <deepak_puri (AT) progressive (DOT) com> wrote

Quote:
Andrés,

I checked the list of VBA functions exported by the VBAMDX assembly
(this is outlined on page 363 of the Applied MSAS 2005 book by Teo
Lachev), and Date() is still there. So the problem is probably due to a
collision with the reserved usage of Date elsewhere - this also happened
with Log().

Enclosing "Date" in square brackets resolves this issue:


With Member [Measures].[Today] as
CStr(VBA![Date]())
select {[Measures].[Today]} on 0
from [Adventure Works]
---------------------------------
Today
4/25/2006



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***



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.