.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

Sql Count greater then 10?

Posted By:      Posted Date: September 14, 2010    Points: 0   Category :ASP.Net
Hey I would like to know if someone can please help me I have a Sql query (I made it shorter for an example) below select top 4 Count (distinct[x].ProductID ) as [Count], y.Category as Category FROM [y] left OUTER JOIN [x] on [x].CategoryID = [y].CategoryID where x.MainID in (SELECT item FROM split(@MainID, ';')) group by y.Category order by Count desc the results will show all Categories with the Count next to it... I need to get the sql query to only get all the Categories with a Count greater then 10...How can I get this?.. .........what do I need to do to let the Sql Query work? I would appreciate you help and time a lot Thank you again Regards Jake

View Complete Post

More Related Resource Links

Print row count on Label



I have an SP that simply performs a COUNT(*) from a table. I'm am trying to print that number in an ASP Label. It works in Query analyzer but I cant wrap my head around how to display it in a label. Any guidance much appreciated. 

Thank you. 

Count words in the ascx file



I have 163 .resx files. I want to count the words in these files, because my want to translate the sentences (my task is the localisation).

Now I'm opening each file in Ms Visual Studio and I count words manually. How can I count words in all files? And the second question: can I use a program what grab strings from .resx into an editor where I can translate them and save bacn into .resx files? Or must open the files one by one and edit the text fields manually?

Thanks for helping, unfortunately I'm not a programmer.

How to display a count of search results with keywords in a label?


Sorry for a basic post here; I am very new to VB!

I am currently building a search page, which includes a textbox and two drop-down lists, a search button, and a datagrid. If results are found and displayed, I would like a label to display:

(e.g.) "24 results found for 'blue sky clouds' "

...where the integer represents the results count, and the keywords and/or drop-down list selections are included in the string.

If no results are found I would like the label to display:

(e.g.) "No results were found that match your selection. Please try again"

I would also like the label to be invisible until a search occurs.

Thanks in advance!

Editor's Note: Rich Clients Count Too


It's the dead of winter here at the MSDN Magazine offices, and we're having a blast. Temperatures are making their daily struggle to stay above zero. The tempting aroma of chestnuts roasting on an open subway ventilation grate fills the city with a wintry mix of excitement and anticipation.

MSDN Magazine February 2003

Question about Greater/Less Than if Value is Null


Currently on my site I am displaying wins and loses based on the score of an event. I got this to work except when both of the values are null. Until an event happens the values are null so when I am trying to show a greater than or less than statement that is grabbing a null value I get an error because it's not in the correct format. I also checked out this article here: http://www.codeproject.com/KB/cs/AgileWare_Convert_Int32.aspx

This code is within a DotNetNuke module right now and crashes because of this format. So basically I am looking to modify my statements below in some way where if the value is null it will still display on our site. Obviously if the values both show 0-0 it works but that isn't really an option for me to use prior to the event happening. Any help is appreciated. Thanks!

I've tried both Convert.ToInt32:

  if (objAwaySchool != null)
                    string strSchoolId

Items count in scope "not available" in on WFE while it is correct in another WFE

Recently, we added a new WFE in the farm to do load balance. After installation, the search is not working occassionally(almost 50%). It apparently hits the new server. The error message:
Your search cannot be completed because of a service error. Try your search again or contact your administrator for more information.

I checked the Items count on view scopes. It is correct on old WFE, while it is "not available" on new WFE.
 In the Office Sharepoint Server Search Seveice seeting, I checked "Use this server for indexing content" and "use this server for serving search queries". I had ever tried to uncheck ""use this server for serving search queries". It is not working, either.

Any suggestion?

How to get character count in 'Multiple Text 'column using Calculated Column?


Hi All,

I have a multiple text box in a list

I want

  • A column which lists number of characters in multiple list column example 188, 199 etc
  • Multiple character column must not have more than 200 chars
Is this possible?

Appreciate all the help!


Count Query Execution


I have a class that being used to connect with the DB. Now I want to count how many times each web request executes the queries, but I've no idea where to store the counted value. I mean, Session wont, ViewState wont work as site also have webservices. What else I can use ?

count the num of rows in dataset



Anyone can tell me which part when wrong if my code is wrong ?

I'm using VS2010 have a dataset. Here is my code.

Dim temp_sec As Data.DataSet

temp_sec = ac.getTempTime("741", "10 July 2010")

suppose to have 13 rows yet i got my msgbox is 0 rows Undecided

Regex for checking number greater than 9

Hi All , I need to write a regex which can check for a number greater than equal to 9 .  

count by casetypes with some logic

I have this query which displays all the SpecimenTypeNames for all our cases for a ComponentID. SELECT APVX.DOS.SpecimenType.SpecimenTypeName      FROM         APVX.ORDERS.ComponentOrder INNER JOIN                       APVX.ORDERS.ApCase INNER JOIN                       APVX.ORDERS.TestOrder ON APVX.ORDERS.ApCase.CaseID = APVX.ORDERS.TestOrder.CaseID INNER JOIN                       APVX.ORDERS.TestOrderSpecimen ON APVX.ORDERS.TestOrder.TestOrderID = APVX.ORDERS.TestOrderSpecimen.TestOrderID INNER JOIN                       APVX.ORDERS.Specimen ON APVX.ORDERS.TestOrderSpecimen.SpecimenID = APVX.ORDERS.Specimen.SpecimenID ON                       APVX.ORDERS.ComponentOrder.TestOrderID = APVX.ORDERS.TestOrder.TestOrderID INNER JOIN            &

MDX to get a count on a hierarchy

Hi I want to get the number of customers that placed orders for items from more than 2 Product Category in a month in the Adventure Works 2008 DW database. Can someone help me with the MDX expression? thanks


We have the following query:   SELECT H.VEHICLE_ID,                 COUNT(ISNULL(H.HISTORY_ID, 0))            FROM VEHICLES V LEFT OUTER JOIN VEHICLE_HISTORY H              ON V.VEHICLE_ID = H.VEHICLE_ID           WHERE H.SPEED >= 65             AND CONVERT(DATE, H.GPS_TIME) = CONVERT(DATE, DATEADD(DAY, -1, GETDATE()))        GROUP BY H.VEHICLE_ID;   Unfortunately, if there inst a record for a vehicle for the current day in VEHICLE_HISTORY, or there inst a record over 65 in VEHICLE_HISTORY, the query simply does not include the result. How can we include all results (i.e. return 0)? What we want is the number of rows returned to match the number of rows in the vehicles table. I thought doing the LEFT OUTER JOIN would take care of this, and return a result for all vehicles.   Thanks.

Function count through Regular Expression

Hi, I have a table with varchar(max) column. This column stores all the function calls to application. Example 1    SUM(SALARY); AVG(LEAVES)/COUNT(DAYS); 2    SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES); The above output shows the requests of User 1 and 2. User 1 called SUM, AVG and COUNT functions once. User 2 called SUM once and AVG, Count twice. I need to calculate these counts through Regular expression in SQL Server 2005. Following is script for table and data generation: CREATE TABLE [dbo].[UserRequests] (  [UserID] [int] NOT NULL,  [Requests] [varchar](255) NULL ) ON [PRIMARY] insert into [dbo].[UserRequests] values (1, 'SUM(SALARY); AVG(LEAVES)/COUNT(DAYS);') insert into [dbo].[UserRequests] values (2, 'SUM(SALARY)/AVG(SALARY); AVG(LEAVES)/COUNT(DAYS); COUNT(EMPLOYEES);') Any suggestion or idea would be highly admired. PS: if someone has another optimized solution for this problem, kindly suggest that as well. Regards.

Page View Count And Users Online

Hello forum I have a couple of questions.  How do I go about tracking the number page views for my web page in a sql table?  Secondly, how do I track the number of users currently online? Any help will be greatly appreciated. Thanks  

DPI greater than 100% causes RDP problems

Hi everyone, we are developing a program combining several remote control programs. Recently we exposed a problem with the RDP ActiveX control from mstscax.dll in conjunction with using dpi at 150%. I created a test solution in Visual Studio 2010 and put the control "Microsoft RDP Client Control - version 8" on a new form. If you reconnect to a disconnected RDP session and the left side of the rdp control is NOT on the left edge of the monitor we have an "unclickabl" area in the rdp connection. Seriously if you logout instead of just disconnecting rdp control works as expected. Can anyone give me a hint how we can solve it, if it possible? greetings    

C# .NET SqlBulkCopy inserted row count

Im using a Script task to extract data from Oracle into SQL Server using SqlBulkCopy. I need to get a count of rows inserted by the SqlBulkCopy and cant figure out how to do this. I did try the SqlRowsCopied event, but it looks like I need to fill the NotifyAfter property to get the SqlRowsCopied to fire. I am confused because if I have say 11 rows in the source, and set the NotifyAfter to 100 it doesnt fire. If I set the NotifyAfter property to 10, then the event fires and I get the count of 10 and not 11 (however, 11 rows get inserted). Is there an efficient way to get the RowsCopied for the SqlBulkCopy?  ThanksYou are so wise...like a miniature budha covered in fur. -Anchorman
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