.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

Finding the first and last dates in a set

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :Sql Server


I am new to MDX and am trying to create a query which gives me the minimum and maximum dates to populate my SSRS 2008 date parameters based on the selection of a previous parameter, here is what I've come up with so far but the problem I'm having is that the date returned varies depending on the order in which the first parameter is passed:


set cityset as {[Geography].[City].&[Alhambra]&[CA],[Geography].[City].&[Abingdon]&[ENG]}


View Complete Post

More Related Resource Links

Finding Rows in ADO.NET

ADO.NET implements three basic forms to locate Rows - The Find method as applied to the Rows collection, the Find method as applied to the DataView object and the Contains method as applied to the Rows collection.

DataRowCollection Find and Contains Method

The DataRowCollection is a major component of the DataTable. While the DataColumnCollection defines the schema of the table, the DataRowCollection contains the actual data for the table, where each DataRow in the DataRowCollection represents a single row.

You can call the Add and Remove methods to insert and delete DataRow objects from the DataRowCollection. You can also call the Find method to search for DataRow objects that contain specific values in primary key columns, and the Contains method to search character-based data for single words or phrases.

DataView Find and FindRows Method

Using the Find and FindRows methods of the DataView, you can search for rows according to their sort key values. The case-sensitivity of search values in the Find and FindRows methods is determined by the CaseSensitive property of the underlying DataTable. Search values must match existing sort key values in their entirety in order to return a result.

Finding username


Im running a query where it selects a property from the user with the matching username but i dont know how to find out the username of the currently loggedin user.

Please Help!

{ End Bracket }: Finding the Best of the Best


Passion, intelligence, and the love of learning exemplify the ideal Microsoft candidate. Howard Dierking explores these and other recruiting philosophies.

Howard Dierking

MSDN Magazine February 2008

C++ at Work: IRegistrar, Finding Submenus, and More


This month DLL problems, context menus, MFC strings to managed C++, and more.

Paul DiLascia

MSDN Magazine October 2006

Review It: Expert Tips for Finding Security Defects in Your Code


Reviewing code for security defects is a key ingredient in the software creation process, ranking alongside planning, design, and testing. Here the author reflects over his years of code security reviews to identify patterns and best practices that all developers can follow when tracking down potential security loopholes. The process begins by examining the environment the code runs in, considering the roles of the users who will run it, and studying the history of any security issues the code may have had. After gaining an understanding of these background issues, specific vulnerabilities can be hunted down, including SQL injection attacks, cross-site scripting, and buffer overruns. In addition, certain red flags, such as variable names like "password", "secret," and other obvious but common security blunders, can be searched for and remedied.

Michael Howard

MSDN Magazine November 2003

C++ Q&A: Finding a Win32 Handle, HTML in CHtmlCtrl


This month Paul DiLascia discusses how to find windows with GetLastChild and outputting HTML with a C++ procedure equivalent to document.write.

Paul DiLascia

MSDN Magazine August 2003

Need function to find difference between two dates


Hi all

I need a function written in vb to find the exact month difference between two dates.

For example

    Start Date : 01/01/2010

    End Date   : 15/02/2010

 then the difference value should be like this 1.5  i.e i need the difference in decimal value.

Finding a control from a control collection



I'm trying to write a bit of code that will format all the numeric values in lables in my gridview. here's what i am doing right now:

On the RowDataBound Event, i create a row object for the row that is currently being bound.
then i go use the FindControl method to grab each label by name.

Problem is there's too many columns in this table and i really dont wnat to have to type it all out. Here's an example of what i am currently doing

' Get row being bound
Dim myRow = e.Row

' Get labes to be formatted
Dim lblMunicipalIncineration = CType(myRow.FindControl("lblMunicipalIncineration"), Label)

' format labels
If lblMunicipalIncineration IsNot Nothing Then
    If Not String.IsNullOrEmpty(lblMunicipalIncineration.Text) Then
        lblMunicipalIncineration.Text = FormatNumber(lblMunicipalIncineration.Text, 0, TriState.False, TriState.False, TriState.True)
    End If
End If

Can i use myRow.Controls to grab a list of all the controls and then somehow get a list of all labels in the collection and then use a for loop to go through and format each label?

How to increment default dates in the subscription


I have a report that I want run on a monthly subscription, but the report has a default date parameter. Is there a way to have the default date parameter increment each month. So if I choose to receive the subscription monthly I would want that default date to increment.

Get Dates from Sunday thru Saturday


I'm using the date picker and I need to know how (or if it's even possible), to select a date, and based on the date, have the actual query use the week the date was in and return all the records from that week (Sunday through Saturday)

Like - if I pick 8/24/2010 - it returns a date range of 8/22 through 8/28
I'd also like to display the date range in the report, somehow

Any ideas on how I do this?

QUERY filter dates by DAY

i have the following data : first column: dates and 2nd column: values i want to filter the dates per day and calculate the AVERAGE of their values per day i can filter them manually by setting day(datetimefield) = 12 and calculate the AVERGAE but i dont know how to do it for all in one query? each record resulting the average of that day   2010-07-12 00:00:00.000 900 2010-07-12 10:00:00.000 1000 2010-07-12 10:10:00.000 1200 2010-07-12 12:00:00.000 1100 2010-07-12 15:00:00.000 1300 2010-07-12 15:10:00.000 1500 2010-07-13 00:00:00.000 6500 2010-07-13 10:00:00.000 5500 2010-07-14 00:00:00.000 5500 2010-07-14 10:00:00.000 4400 2010-07-15 10:00:00.000 4500 2010-07-16 00:00:00.000 1000 2010-07-17 00:00:00.000 7000 2010-07-18 00:00:00.000 8500 2010-07-19 00:00:00.000 1500 2010-07-20 00:00:00.000 1700 2010-07-21 00:00:00.000 1900 2010-07-22 00:00:00.000 2000  

Hiding other month dates in ASP .Net Calendar Control

Often we need ASP .Net calendar control in our webpages. Most of the times we require navigation in between dates of the calendar control but there can be a requirement that when we want that users should not be able to select dates from month other than the current month.Some people might be thinking in mind that Microsoft has provided theShowNextPrevMonth property of a calendar control which can be set to false in order to disable the navigation in between months. Ok, this will disable navigation but what about the dates of adjacent months shown in current month?Following is the output of a normal Calendar control when ShowNextPrevMonth is not set to false.Note the red circles in above image. July and September will allow you to navigate through other months and red circles below will allow you to select dates of adjacent months.Ok now we set the ShowNextPrevMonth property to false and see the output. Following is the output in this case.So setting out the ShowNextPrevMonth property has disabled the July and Septemberlinks but dates of adjacent months are still there which can be selected as well. How to disable/hide these? Unfortunately there is no such default property provided using which one can disable or hide these dates but fortunately doing this using code is not a complex task. Use following code a

Finding correct "system.webServer / modules / add"

For example, in web.config you can use... <system.webServer>      <modules>         <remove  name="DefaultAuthentication"     />         <add     name="DefaultAuthentication"     type="System.Web.Security.DefaultAuthenticationModule" />      </modules>   </system.webServer> ...for getting rid of precondition="managedHandler". Where can I find the names and types of the other modules? I suspected that somewhere in the hierarchy there should be some XML describing the defaults. However, I cannot find it. Am I missing some machine.config, web.config file? Michael G. Schneider

passing dates in stored procedure?

I am trying to pass dates in  a stored procedure and keep getting an error - here is the code and error.  eventually the sproc will be used in SSRS.     ALTER PROC [dbo].[USP_SPROC_X] @DATE DATETIME AS SELECT ITEM , PRICE , SELL_DSCR , PRC_EFF_DT , PRC_END_DT , PROPOSED_BY ,CONFIRMED_BY FROM SALES WHERE @DATE BETWEEN PRC_EFF_DT AND PRC_END_DT   Msg 4104, Level 16, State 1, Procedure [PROCNAME], Line 141 The multi-part identifier "PRC_EFF_DT" could not be bound.

Finding a WPF control by Name in a Panel

How can I loop through the controls collection of a WPF panel and find a control by name?  The StackPanel1.Children(0).Name property does not exist. I looking for a method equivelent to this WinForm code... Friend Function DBX_FindControlByName(ByRef objContainer As Object, _   ByVal strControlName As String, _   ByRef objFoundControl As Control) As Boolean   Dim objControl As Control = Nothing   If Not IsNothing(objFoundControl) Then Return True   Try   'objContainer must be a controls collection like Me.Controls   For Each objControl In CType(objContainer, Control.ControlCollection)   If objControl.Name.ToUpper = strControlName.ToUpper Then objFoundControl = objControl   Exit For   Else   If objControl.HasChildren Then   'This control has children so it must be a container DBX_FindControlByName(objControl.Controls, strControlName, objFoundControl)   End If   End If   Next   Return True   Catch ex As Exception strErrMsg = "DBX_FindControlByName." & objControl.Name & ": " & ex.Message   End Try   End Function Thanks. Mike

Finding broken links in a web of Pages

I have a dozen sub-sites all with large Pages libraries of .aspx pages created and maintained under the Publishing features on  MOSS 2007.  Some links also go to Document libraries. How do I detect broken links within the web of .aspx pages? 
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