.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

Sales Total, Get Curent Month

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :ASP.Net
The date functions in sql is pretty complex to me. I want to get the sum of Grand Total for the current month. OrderDate is a DateTme Column. SELECT SUM(GrandTotal) FROM CompletedOrdersHistory WHERE OrderStatus='COMPLETED' AND OrderDate=@CurrentMonth;

View Complete Post

More Related Resource Links

How to Get Total Sales for Customers that ever bought Product X


Hi,  does someone know ?
A) How to Get Total Sales for Customer(s) that ever bought Product X     ?  (including/excluding Product X)
B) How to Get Total Sales for Customer(s) that never bought Product X   ?

How to do this in MDX and in Excel Pivot ?



IN SSAS 2005, total count is incorrect for a partial month



IN SSAS 2005, when I navigate Cube->browser and I drag my fields "Day of week" to rows and couple of measures namely "M1" and "M2" to columns

and applied a filter "hierarchydate" in the filter section(eg partial month Jan 10 to Jan31), I get the total count incorrect. I also have the following observations

1) for example "Instead of giving Sunday "Sub total" for that partial month i.e "Jan 10 to Jan31", it is displayed with all the Total Sunday's count for all the years

2) IN Cube-> browser , it is working fine, if I apply the filter in "select dimesion" section instead of applying filter in "drop filter fields section"

Is there any such kind of issue in SSAS 2005?

Please reply me ASAP if you have any information

Total Sales and Total Last Year Sales


I have this code below that works fine. But since i have filtered the query to only show 10 specific items. I only get the total yr and ly sales for the specific items. I want to get the Total Sales for all items. Is there a way i can create a set or a measure that would show the Total sales no matter what the item number. Without having to take the filter off the report. Please help!


Also I want to add that I want to display ranking on the sales for the selected items only. So this is why i did the report this way.





MEMBER [Measures].[LY Sales] AS (ParallelPeriod([Time].[Fiscal Period].[Year], 1, [Time].[Fiscal Period].CurrentMember), [Measures].[Vet PL Gross Sales Amt])


NON EMPTY{[Measures].[Vet PL Gross Sales Amt] ,  [Measures].[LY Sales]}


, NON EMPTY { ( (DESCENDANTS([Sell To Customer].[Geography].[RC Division].&[0], 

[Sell To Customer].[Geography].[Customer]) 

* [Sell To Customer].[City].[City].ALLMEMBERS 

* {[Brand].[Brands].[Item].&[230],




Total sales past 12 months



I want to do something as simple as Adding the previous 12 months sales to a row.

My tablix report is suppose to look something like this:

Year Filter: 2010

Months:           Months Sales           Sales Past 12 months
Jan                    12345                        67890
Feb                    23456                        78901
Mar                    34567                        89012
And so on

So ... in the third column, Sales Past 12 months, say for Mar 2010, the Sum should be something like:
Sales Mar 2010 + Sales Feb 2010 + Sales Jan 2010 + ... + Sales Apr 2009 = 89

Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

UDP Delivers: Take Total Control Of Your Networking With .NET And UDP


UDP, the lesser-known sibling of TCP, is used for DNS resolution, SNMP network status, Kerberos security, digital media streaming, VoIP, and lots more. Learn how to put UDP to work for you.

Yaniv Pessach

MSDN Magazine February 2006

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

Total newbie question: Calling jQuery in an UpdatePanel?



Please forgive this ignorant question - I've used ASP.NET AJAX a good deal but I'm new to jQuery.  Specifically, is it possible to call or create jQuery events on the fly via an UpdatePanel?  For example, calling a jQuery modal or animating a Label (or <div> contained Literal), etc.

If anyone has any advice or could point me to some easy tutorials on mixing ASP.NET AJAX and jQuery, I'd greatly appreciate it. 



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

Calculating GridView total using JavaScript/JQuery


Hello everyone.

One month ago I've had very nice conversation with a asp.net forum member asking about issue regarding calculation of GridView textboxes total using JavaScript. The main thing was to allow user to manually write values in the text boxes (placed inside GridView column) and if the value has changed automatically to perform calculation on client side.

At the end of the conversation, we came up to two solutions. The first solution was using plain JavaScript, but since I thought it was not so robust, and in order to make it more robust we would need to write few more functions. Therefore, I have simply proposed another solution using JQuery which came up much better, more robust with less code.

In this blog post I will show both of the solutions and will provide step by step explanation on how we did that.

Note: I'm using VWD.

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?





Get cumulative total value on x-axis.

I'm currently displaying: January $200 February $100 March $400 I want to display:( i've set the custom to MMM on the axis-properties, but still the months are not getting into below required format)  Jan $200 Feb $100 Mar $400 Total $700 on the x-axis.  And i want the y-axis to be divided in the intervals of 200, but though i've set the interval as 200, it is displaying in divisions of 2000.

Calculating Full Year Total

Im creating a sales report in SSRS by pointing it at a cube in SSAS.  Im creating calculated members to aggregate my data in various ways so they can be shown on the report.   I have a FACT table containing sales figures and various dimension tables including a server created time dimension.   Ive managed to create pretty much everthing I need (e.g. Current YTD, Prior year YTD).  What I now need is a full year figure to compare current year sales to.   Below is what Im aiming for i.e. the total of 122712 from 2009 appearing against every month in 2010.   Fiscal Year Fiscal Month Count Full Prior Year sales 2009 Apr-09 9805     May-09 9942     Jun-09 8986     Jul-09 9696     Aug-09 8912     Sep-09 10097     Oct-09 11713     Nov-09 10434     Dec-09 8820     Jan-10 10821     Feb-10 11844     Mar-10 11645     Total 122712   2010 Apr-10 3517 122712   May-10 1669 122712   Jun-10 2518 122712   Jul-10 3306 122712   Ive been bashing my head against a brick wall with this one so any help would be gratefully received!

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
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