显示标签为“functions”的博文。显示所有博文
显示标签为“functions”的博文。显示所有博文

2012年3月29日星期四

flow functions ?

Hi

Does anyone know where can I find a list of flow functions valid in MDX? The list in

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/mdxref9/html/e363722a-3e5b-40a9-a0b5-399dd2d93f6d.htm ist not complete. For example: the case when else end function is not there. I really need a switch.

Thanks!

Have you looked at this article. http://msdn2.microsoft.com/en-us/library/ms144841.aspx

It's a bit short, but should give you some general idea.

Hope that helps.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

2012年2月26日星期日

First Saturday Of The Year

Hi,
Is there a function that could return the first saturday of the year? If
not, is it possible to make use of existing functions to arrive at an
equivalent function to do this?
Regards,
EricEric,
I think the easiest way to do this is to build a calendar table that holds
the data, then you can simply join to this.
Mark Allison, SQL Server MVP
http://www.markallison.co.uk
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602m.html
"Eric" wrote:

> Hi,
> Is there a function that could return the first saturday of the year? If
> not, is it possible to make use of existing functions to arrive at an
> equivalent function to do this?
> Regards,
> Eric|||There is no bult-in function to do this, but as Mark says i would prefer
building up a calendar table (Temporay, you only need the at leat first 7
Days of the year) and get the specific Weekday (depending on your sttings
for the DATEFIRST setting.
Creating of a temptale with calandar entries can be found here.:
http://www.aspfaq.com/show.asp?id=2519
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
--
"Eric" <Eric@.discussions.microsoft.com> schrieb im Newsbeitrag
news:664EF52B-BDAE-4A61-810F-D1B3FD5F0B45@.microsoft.com...
> Hi,
> Is there a function that could return the first saturday of the year? If
> not, is it possible to make use of existing functions to arrive at an
> equivalent function to do this?
> Regards,
> Eric|||On Tue, 10 May 2005 18:32:01 -0700, Eric wrote:

>Hi,
>Is there a function that could return the first saturday of the year? If
>not, is it possible to make use of existing functions to arrive at an
>equivalent function to do this?
>Regards,
>Eric
Hi Eric,
Mark and Jens are correct: a calendar table is probably the best
solution for this. However, here's a function that will give you the
desired result for years 2000 and later (assuming that the date is ion a
column called TheDate):
SELECT DATEADD(day,
DATEDIFF (day,
'20000101',
CAST(DATEPART(year, TheDate) AS varchar)
+ '0107') / 7 * 7,
'20000101')
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)