.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

SELECT 1st of the month and last of the month

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :

How do I retrieve the first of the month for the min and the end of the month for the max


My query looks like this below…


select min(date)

       , max(date)




View Complete Post

More Related Resource Links

How to select cuurent month in sqldatasource?


Hi all,

I have a sqldatasource statement. How can i select current month in my statement?

Here is what i done.

<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
                SelectCommand="SELECT SUM(Amount) AS Total2 FROM Budget WHERE (UserId = @UserId) AND (CategoryId = 1) AND (CreateDate = @CreateDate)">
                    <asp:SessionParameter Name="UserId" SessionField="UserId" DefaultValue="" />
                    <asp:Parameter Name="CreateDate" Type="DateTime" />


in page load C#,


if (!this.IsPostBack)
                SqlDataSource3.SelectParameters["CreateDate"].DefaultValue = tnow.Month.ToString();


But i get this error <String was not recognized as a valid DateTime>.

How can i do it?

Any help is appreciated.

Thank you.



dropdownbox which selects records based on criteria (TODAY, THIS WEEK, THIS MONTH, etc)


I have a dropdownbox which I want to use to search records based on a timescale. The gridview populates results based from that search.

So here is how I want to work this;

If a user selects "today" - a list of records input today are populated. If "this week" is selected, a list of all records added within that week from todays date is populated.

I created a forum on this issue previously but to no avail whatsoever. How do I work around this problem?

Help would be much appreciated

Azure One Month Pass


Just saw this Azure offer.  You can try Azure for free, no credit card required, for a full month.

25-08-2010 7-24-07 PM

Get all the details here and read the fine print (like US only)

Bookmark and Share

Crawler fails to register date properties of user profiles with the month of January, April, August


This seems to be a bug when the crawler search the user profiles in MOSS 2007.  When crawled, user profiles with a SPS-HireDate in the months of January, April, August and December will be detected, but a full-text (SQL) search returns those profiles without the HireDate field.

User profiles with HireDates in other months work correctly, returning the HireDate in the search.  And changing the month of a problematic user profile also fixes the problem.

This problem is also reflected in the fact that while we have 499 user profiles using the SPS-HireDate property,  the managed property page from the search section only has 350 items with the HireDate property.

We're running MOSS 2007 32bit with SP2 with an English language base and the Spanish language pack. I'd considered date format problems, but I can't imagine how some months would work, while others wouldn't.

Any ideas?

Applying custom CSS to the MOSS 2007 Calendar control Month view



I have a requirement to use the MOSS 2007 Calendar Control - month view is to apply a custom css to have a look and feel as per our requirements.

We tried applying the custom css to the MOSS 2007 calendar control - month view, it does take the custom css and applies it, but when i click on any date and come back to the calendar control, it changes the CSS of the MOSS calendar control back to the default one.

Let me know if anyone has any suggestion on  how to customize the calendar control for css for our intranet application.

Your response would be highly appreciated.






month days in gridview


 Hello all,

I have a challenge of which I can't figure out how to achieve it.

at this moment I have a gridview that can be dynamicly filled with cell's based upon the number of items selected (throug a drop down list) by a user.

the user then can enter some values in the cells to perform a bulk insert.

What I rather want is that the user selects a month, like august, and then  the gridview is filled with the amount of days from that month, so you get 31 cells in the gridview. second all the first cells should be filled with the daynumber for that day...

I hope the explanation is clear :)


Does anyone know a solution to this?





Getting Users who logged on in last month

Hi all, Using Sql Server 2005. Is it possible to retrieve from Sql Server the name and times of all users who logged into the server in the last month? Regards Melt

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

Where to add month column?

I'm new to ASP.NET and am not sure where to put this. In my SQL server database I have a view that includes "transaction date"(TransDate) as a column. I want to create a Report (rdlc) that shows data grouped by Transaction Month. Where is the best place to add the month column - in the view, in the app's dataset, or somewhere else? I tried adding it as a column in the dataset but that does not seem to work correctly.  I don't know how to set up the column to tell it to pull the data from TransDate and use only the month. Please help. Thanks.    

Customize calendar to view next month

I was wondering if there is a way to change the calendar view on SharePoint so that it defaults to next month.  Will I have to create a custom web part for this functionality or can I create a view and manipulate it with filters? Thank you in advance.

Remove time from Month Calendar view

We have a calendar part on a page that has very narrow boxes for each day. As such we want to remove the time from appearing before the title of the event. I have managed to do this through css where there is only one event. However, have not been able to remove it where there are mutiple events. Any ideas on how this can be removed in both scenarios? Cheers, Theo

SSAS Calendar Week commencing with split at month

Hi all, Wonder if someone can help. Our CFO wants to see a cube calendar that shows week commencing but stops at the end of month. For example if the dates are Monday  28th   Tuesday  29th   Wednesday 30th   Thursday 1st    Friday  2nd Saturday 3rd Sunday   4th So for this example the week commencing is the 28th of Month 1 and Thursday is week commencing 1st of the next. I am having a problem seeing how I can do this. If I add the weeks to a standard calendar I get the week commencing 28th which includes the 7 days, naturally. I cannot help feeling I am missing something obvious. Cheers

How to create a calcuated member, which will always return the date one month before the currentmemb

I need to create a calculated member in the cube script, which will be subsequently used in various other script calculations.  It needs to return the date, which is 1 month before the currentmember of the Date dimension. I tried something like this: CREATE MEMBER CURRENTCUBE.[Measures].[LastPD]   AS           PARALLELPERIOD([Date].[Calendar].[Month], 1, [Date].[Calendar].currentMember) ,VISIBLE = 1; However when I then try to check the values with this query: SELECT [Measures].[LastPD] on 0, [Date].[Calendar].[Date].members on 1 FROM [TravCSAT] ; I only get NULLs for [LastPD].  Any idea what I am doing wrong?

Group Results By Month, showing each month as the column

I have to list 50 states and the # of population per month. right now my results look something like..   CA, June, 5000 CA, July, 6000 CA, August, 7000 CA, September, 7230 I want it to show.. State, June, July, August, September CA, 5000, 6000, 7000, 8000 NJ, 4013, 5030, 7020, 7310   I was going to use a PIVOT table but.. I want the columns to expand as the coming month  comes upon us.

Date format for Year, Year-Month, and Date (Year-Month-Day) where input is not known

I have a requirement to capture historical events in a table. Now some events will have only Year, some Year/Month, and remaining where Date is known. We should be able to store them in the column and be able to sort etc. When publishing the information, we should be able to publish as was the input, Year only, Year-Month only, or Date. I looked at the newer Date data type. I can insert a 4 digit year, but on retrieving it is YYYY-01-01. I do not know if it has input YYYY or YYYY-MM-DD and is indeed a Date or a Year. I am trying to avoid saving the format information in another column or something. For sorting, when records have same Year, I would have another column to do relative sorting... So question is - what are my best options with SQL/Entity Framework combo. And what others have done, when encountering similar - if any. Thanks in advance. --Sharad 

can I controll the change on calendar's month

hi all,  I have calendar in asp net 1.1 , I just wonder can I customer controll the change on the month ,  can I use the drop drown month to change the month in calendar ?  thnak you 

Problem Install of Microsoft .net Framework 3.5 for over a month.

I have looked at all suggested solutions and had tried all the I found.  No success. I had .net running using Roxio Creator 2009 until the update came out in Feb. 2010. I am using Vista Home premium sp2. I have created the Cab for the files.  Where do I send it? Microsoft .NET Framework 3.5 Service Pack 1 and .NET Framework 3.5 Family Update (KB951847) x64 Installation date: ‎3/‎20/‎2010 5:33 PM Installation status: Failed Error details: Code 643 Update type: Important This update is applicable to Windows Vista Service Pack 2 and Windows Server 2008 Service Pack 2. The Microsoft .NET Framework 3.5 Service Pack 1 is a full cumulative update that contains many new features building incrementally upon .NET Framework 2.0, 3.0, 3.5, and includes cumulative servicing updates to the .NET Framework 2.0 and the .NET Framework 3.0 subcomponents. The .NET Framework 3.5 Family Update provides important application compatibility updates. This update is provided to you and licensed under the Windows Vista and Windows Server 2008 License Terms. More information: http://go.microsoft.com/fwlink/?LinkId=133335 Help and Support: http://support.microsoft.com
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