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

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

MDX find last (flagged) day of previous month

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

I need to find last working day of previous month in Calendar hierarchy for a given date - any help on this? The last day of every month is indicated by MonthEnd flag that is related to Date attribute. I need to get figures for this date in MDX query.

My Calendar dimension has Calendar hierarchy that has year, month, date levels. Also, there is a MonthEnd attribute related to date that is either yes/no.

Thanks. Pl note I cant use SSAS stored proc .


I have a solution but seems to be complex.

select {
		{NULL:ClosingPeriod ([Calendar].[Calendar].[Date], 
	).Item(0).Item(0) ,

	[Calendar].[Calendar].[Date].&[20100925]} on 0


View Complete Post

More Related Resource Links

How to Correlate Last weekday of previous Month and First Weekday of current Month ? - T-SQL 2005

Hi friends, below is my detail description. I woulld like to show busines users Previous Months Last Weekday in Drop Down List as a Parameter. Now, if they select Previous Months Last Weekday, then i need to pass First weekday of Current month. How can i correlate this things ? if you need more information, let me know.   Thanks.

first date of previous month?

How to get the first date of previous month?
PS.Shakeer Hussain Hyderabad

find previous row


Hi guys

need help to write select query to find the previous records for particular id... i can do that in oracle using its inbuilt LAG () function but how to do that in sql.... sql server don't have lag() function

Please help me in this.

thanks & regards

Need Help - Grouping multiple fields to get top 10 for month then using that data to get previous mo



I’m querying a database in BIDS using SQL 2005 to produce a report in SSRS. All the information I need is in one table.

The table has 3 columns. The data within each column can be identical but when the 3 columns are grouped together they make up a unique set.

For example:
Month     Col 1     Col2       Col3
201009   Field A   Field B   Field C
201009   Field A   Field B   Field D

201009   Field A   Field B   Field D

201009   Field A   Field E   Field C
201009   Field B   Field B   Field F

201009   Field B   Field B   Field F
201009   Field B   Field G   Field G
201009   Field C   Field B   Field F

I need to count the number of times these unique sets appear each month and produce a report showing the to

Find value in previous row of GridView_RowDataBound


Using vb.net/asp.net 2005.

In the gridview_RowDataBound event I am trying to find out the values from previous row but its giving me an exception.  does anyone know how to do this?  I need to do this because if the value is the same then I need to hide certain columns.

the line giving me an exception is this:

MyGridview.Rows(e.Row.RowIndex).Cells(0).Text <> ""

here is what I have now:

    Protected Sub grdvMyGridv_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles myGridv.RowDataBound

        Dim MyGridview As GridView = sender

            If e.Row.RowType = DataControlRowType.DataRow Then

                If (e.Row.RowIndex > 0) Then
                    If MyGridview.Rows(e.Row.RowIndex).Cells(0).Text <> "" Then
                        Dim myString As String = CInt(e.Row.Cells(0).Text)
                    End If

                End If

		'do other stuff here.

            End If
        Catch ex As Exception
            Throw ex
        End Try

    End Sub

How do you determine that the last day of the previous month falls on a Saturday or Sunday?


How do you determine that the last day of the previous month falls on a Saturday or Sunday?

I know that this will give me the last day of the previous month




how to restict time till previous month


Hi all,

i have filter as time period as follows.

2010 (yr)
1    (month)
2011 (yr)
1   (month)

now i need to restrict the time period up to previous month...i.e when we select time in filter need to see upto 2011 year & 4th month..no current month & future month should be
seen. At any time it should show upto previous month of the time...pls let me know how to perform
this in mdx


Retrieving a variable from a previous page



I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.

A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.

How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?


find a Control inside a GridView using jQuery


I have databound GridView in my page and I have a hidden DIV in all rows. Each row contains a Button that I want it to make the DIV visible for me! how can I use that with jQuery?!

here is the code page: 

<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                                EnableModelValidation="True" GridLines="None" ShowHeader="False" Width="100%">

Is there any way to find out the reason for session expiry?


Dear All,

is there any way to find out the reason for session expiry?



Cannot find ASP.NET tab on IIS6+2003,how to choose .NET framework 4.0?


Hi all,

I just wanna setup a .net framework 4.0 on my VPS for a new site. While I could not find the ASP.NET tab on properties. I did some research find some similar problems but haven't fixed it yet.

Any suggestion would helpful.



Using loginName to find ADInfo from an outside class



I wrote a class to pull adinfo and for the life of me I can't seem to figure

out why it says "Invalid Login Name" no matter what I type in. If I leave

it blank it seems to work properly but it doesn't seem to be actually searching

the AD. I'll drop the whole class here, it's being initiated by a button click

on an outside form.


Thanks in Advance for any help Offered,



Imports System.DirectoryServices
Imports Microsoft.VisualBasic
Imports System.String
Imports System.Collections
Imports System.Security.Principal
Imports System.Security.Permissions

Namespace LoginButton
    Public Class LoginButton

        'Class Variables
        Dim UserID As String = Nothing
        Dim DomainDN As String = ConfigurationManager.AppSettings("myConnectionString")
        Dim ADEntry As DirectoryEntry = New DirectoryEntry(DomainDN)
        Dim objSearch As New System.DirectoryServices.DirectorySearcher(ADEntry)
        Dim oResults As DirectoryServices.SearchResultCollection
        Dim oResult As DirectoryServices.SearchResult
        Dim RetArray As New Hashtable
        Dim page As Page = DirectCast(HttpContext.Current.Handler, Page)
        Dim TextLogin = DirectCast(page.FindControl("

LDAP - Can't find server


Hey people,

I would like to get a persons name from their username - a common query on forums i know, but i haven't managed to get mine working yet and any help would be appreciated.

I currently have this code that I found here: http://www.vbforums.com/showthread.php?t=612655 (Thanks Chris128)

I have adapted it from VB into VB.net. The page renders but when i enter my username into the Username textBox and hit the submit button (Which calls IsUser) I just get "The specified domain either does not exist or could not be contacted." I have tried lots of other code but I always get this response...

If anyone can help by posting links to a tutorial or another post for code that they know works, i will give it a go.


Imports System.DirectoryServices

Partial Class UserInfo
    Inherits System.Web.UI.Page

    Private Function GetRealNameFromAd(ByVal UsernameToFind As String) As String
        Using searcher As New DirectorySearcher(New DirectoryEntry())
            searcher.PageSize = 1000
            searcher.SearchScope = SearchScope.Subtree
            searcher.Filter = "(&(samAccountType=805306368)(sAMAccountName=" & UsernameToFind & "))"
            Using Results A

Could not find default endpoint element that references contract 'CurrencyProxy.CurrencyServiceSoap



I created 2 projects in my solution:

  1. Classic asp.net web service (asmx)
  2. Class library project which references service
  3. web site project which references class library project
  4. Windows app project which references service.

Both projects were created in 3.5 framework and in Visual Studio 2008 Beta 2.

I added web service reference to Class library project. When it asked for namespace I typed "CurrencyProxy". Projects build ok, but when I run web app, Class library throws an error: Could not find default endpoint element that references contract 'CurrencyProxy.CurrencyServiceSoap' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

I believe it has something to do with app.config in Class library project. Here is part from app.config:

<binding name="CurrencyServiceSoap" closeTimeout=

Asp to asp.net cant find Msxml2.XMLHTTP


Hi all i have this following code in asp and when i try this in .net it asks me to run in aspcompat=true mode which i dont want.
So i tried to DIM x as Msxml2.XMLHTTP but its not defined any suggestions on this. Thanks

xmlhttp = Server.CreateObject("Msxml2.XMLHTTP")
        On Error Resume Next
        xmlhttp.Open("POST", "https://xxxxx.cgi", False)
        xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
        queryString = "xxxRequestMode=X&xxxRequestData=" & Server.UrlEncode(xmlStr)


Cant find vsi file for CSS Friendly Control Adapters


Hi guys

This is driving me crazy... I cant find the .vsi file for installing the CSS Friendly Control Adapters Project. Does anyone know where I can get this?

The following link: http://www.asp.net/cssadapters/ only leads to the CodePlex wiki where I can download the dll and a partial solution. Essentially, I'm looking for the source code to implement the Menu adapter.

Any help is much appreciated!

Editor's Note: Find Your Anchors


This month, Howard Dierking explores the value of maintaining a few discrete technology interests in order to avoid being swept away in a sea of buzzwords and new technologies.

Howard Dierking

MSDN Magazine September 2009

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