.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to concatenate measures over time period?

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :Sql Server


For an external tool I have to prepare Sales ([Measures].[Sales]) figures for the last 5 months like this: 12345|12343|21423|12344|12343. So basically, I need one measure that displays these values concatenated. How can I create this? (In my MDX query I would have this measure on columns and i.e. another dimension like country on rows).



View Complete Post

More Related Resource Links

The semaphore time-out period has expired

Hi, We have a job that does use linked server to copy some data from a MS SQL 2000 database and insert it into a database which runs in MS SQL Server 2005.This job is configured in the 2005 server. Offlate we started encountering the error OLE DB provider "SQLNCLI" for linked server "RSSDR" returned message "Communication link failure". [SQLSTATE 01000] Error Number::121 Error Message::TCP Provider: The semaphore time-out period has expired. Initially thought its a network issue but network team have confirmed there were no network issue at the specified time.Is it something related to network adapters,card or some other firware. Any help would be highly appreciated. Best Regards, Zainu    

MDX Query Measure with time period

Hi! How to set up the period in MDX? I need the measure what would be seted up by default 4, 29… days from today. For axample Amount from current day (02.09.2010) till 4 days from today is 06.09.2010. As Result I have to get a report: Buy form Vendor Amount today 02.09.2010 Amount +4days 02-06.09.2010 Amount +29days 02.09-30.09.2010 A 10000 250000 333333 B 150000 222222 555555 C 666666 444444 1222222 Sincerely, Milena

SPD to escalate workflows over a period of time

Hello,   I am hoping that you can help me, I have designed an InfoPath form that I am using for an expenses approval, but I would like to set it so if the approver has an Out of Office, the workflow is submitted to a different user. And if the workflow exceeds a specific time range then the workflow is escalated.   I am using SPD to create these workflows, rather than the in built MOSS workflows.   You're help, as always, is greatly appreciated.   Kind Regards, Dayna

Scope and Time Calculations measures

Hi All I’m using a cube with standard Time Member calculations (YTD, MAT, ..). In my project I need to apply these calculations only to a subset of my measures (ex: 10 measures in total, 3 changes by YTD, MAT,.. selection, the others 7 remain with Default Calculation) I tryed to work on “Scope” statement: I don't put in "Scope" the measures that have to remain unchanged. But it doesn’t works. When I select something (YTD, MAT) measure out of scope returns error. Any idea? Note, I would avoid to forced all other measures to “current Period” Loris

Returning Customer Count of all categories in each time period



Lets say I have the following Table:

CustomerNumber | Date | MovieCategory
1 |2010-01-01|A
1 |2010-02-01|A
1 |2010-03-01|A
1 |2010-04-01|A
1 |2010-05-01|A
1 |2010-06-01|D
1 |2010-07-01|A
2 |2010-01-01|A
2 |2010-02-01|A
2 |2010-03-01|D
2 |2010-04-01|D
2 |2010-05-01|D
2 |2010-06-01|C
2 |2010-07-01|C
3 |2010-01-01|B
3 |2010-02-01|B
3 |2010-03-01|B
3 |2010-04-01|C
3 |2010-05-01|C

What I want to do is count the number of customers for each movie type in each date. Now I started with the following simple query

Select Date, MovieCategory, Count(CustomerNumber)
From AboveTable
Group By Date, MovieCategory
Order by Date, MovieCategory

which would be okay, but if no customer has a MovieCategory of say 'B' on a particular date then the results of the above query won't return a row that has

Date| B| 0     (date here could be any date).


which is really what I need. Is there a good way to

AGGREGATE over a time period: how to behave like a distinct count ? (aggregate on the full period an


I would like to compute a measure "MyMeasure" over the last 12 months :

Aggregate({[Event DATE].[Calendar].CurrentMember.Lag(11):[Event DATE].[Calendar].CurrentMember},[Measures].[MyMeasure])

MyMeasure is not a distinct count, so the results returned is the SUM of the distinct count performed on each month over the last 12 month.

What I would like to have is the distinct count over a full year (all months taken together).

For example, suppose that MyMeasure is a simple measure that always returns 1.

The aggregation returns 12 (1 for each month then SUM). I would like it to return 1 (measure on the whole period).

Can somebody help me that's really a very big issue I have to fix !


Sharepoint site getting time period expired



I am having a file which is contain 70,000 data. i try to upload this file into sql server table using front end sharepoint site.i am getting time out period expired error.

But i have added connection timeout=100000 property in connection string still i am facing the same problem

So please help me to solve this issue



NetworkStream ReadTimeOut doesn't wait for the time out period



I am using the TCPClient and the NetworkStream classes to establish a TCP connection and read the data from the network.
The NetworkStream object is set with a time out of 15 sec. The intent is, if the stream can't see any data from the network within 15 sec,
it will throw an exception and return. Something like myStream.ReadTimeOut = 15000. I set this time out once in the beginning just after the TCP connection  and the NetworkStream are created.

Though majority of the times (70%) it behaves nice and waits for the time out period to expire before throwing the System.IOException,
other 30% of the times, it just doesn't wait 15 sec before throwing the exception. It doesn't even wait for 2-3 milliseconds before throwing the exception.

I verified this using another tool, wireshark to time and detect the traffic.

Is the NetworkStream object doing some kind of optimization? Or do I have to do anything special to make it to wait for 15 sec?


Tech Crawler


SQL Server Query request for start and end period of time


Hi all

I have event table where I need to select records between days. my statements look like

  CONVERT(char(8),Event_Table.Event_time,112) BETWEEN 'request start date' AND 'request end date'

The Event_time is DateTime format.


Now everything look fine except from if I need the statement to request the date between as Date_start and Date_End any time it run. The idea is to request a for start and end period of date any time the scrpt run. the script will be run as DOS batch file. 

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

.NET 4 Web Application Startup Time

I was chatting with Jonathan Hawkins and some of the folks on the ASP.NET team about performance and Jonathan mentioned the startup time for large ASP.NET applications is improved on .NET 4. There are some improvements in the CLR and in ASP.NET itself that helped. If you have a giant app, you should do some tests.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend