.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

Get multiple values for each distinct username

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :ASP.Net

I have a SELECT statement that I save into a temporary table and the return table partly looks like this.

Username | areaName
zalkin        | blue
zalkin        | red
zalkin        | green
user2        | blue
user2        | green
user1        | yellow
user1        | red

I need to get the areaName as a comma-separated list for each user. The query should return a table like this:

zalkin   |   blue, red, green
user2   |   blue, green
user1   |   yellow, red

How would I do this?
And also, can I do this in my first select statement, before I create the temporary table?



View Complete Post

More Related Resource Links

jquery autocomplete multiple values


i got some samples and i did autocomplete using jquery , its working well for single input values

but i need to pass multiples values after one by one in the textbox. Is it possible to pass multiple

values in the textbox for autocomplete in jquery in asp.net?


How to store and retrieve multiple values in a single session variable .


I want to store employee name,designation and department in session variable and
retrieve in another page how to do this.

Configure BDC column to have multiple values selected


How do I Configure BDC column to have multiple values selected and make multiple entities data available in the same column.  Currently it supports only single value for an item.  This requirement is crucial need some solution immediately.

BDC Column with Ability to Select Multiple Values


Use Case:

We are creating a storage location for technical product articles. These will be SharePoint publishing pages. Each page will have metadata assigned to it to make it searchable by properties. The possible values for one of the columns (Part Number) could potentially be sourced by our ERP system. I'd like to do this to eliminate the possibility of free-text entry errors, but there are probably over 10,000 parts so a drop-down list isn't feasible.


Ideal Situation:

The end user enters the part number and clicks a button to verify it against a BDC entry from our ERP system. If they weren't sure on the part number they needed, they could do a lookup from that metadata entry screen. They'd need to have the option to add multiple part numbers as one technical product article could reference multiple part numbers.



Is BDC an option for all of this or am I looking at a custom metadata solution? I thought I heard along the way that BDC only supported one value choice, but I couldn't find a verification for that in the forums.



How do you create a custom BDC data field that allows for multiple selected values?

I need help creating a custom data field using the BDC column as a base.  We need to allow for multiple selected values instead of just a single one.  I can't find anything on the net which shows how to do this.

Multiple values in where clause

How do I use the same statement to retrieve 2 values ABCD and XYZ? Now I get only one value ABCD - now I want only 2 values ABCD and XYZ. I'm looking for syntax SELECT [Measures].MEMBERS ON COLUMNS, NON EMPTY [0VENDOR].[LEVEL01].MEMBERS DIMENSION PROPERTIES [0VENDOR].[20VENDOR] ON ROWS FROM [OPOMCHS0/ZQT_GPO_PO_CHNG_REP_SUMM_3]WHERE[0VENDOR].[ABCD] Any help is appreciated

Excel 2007 Filter on multiple values

Hi Everyone,How do I use Excel 2007 Pivot Table's label filters/value filters to filter with multiple conditions? for example, I want to get all customers with customer name start with "G" and doesn't include "E" and with measure>100 and measure between 50-60.Regards,George

Multiple Values Grouping

Hi all, Please could you help to get multiple values grouping implemented properly? I need to group a set of instances by groups. Some instances belong to multiple groups. I have used listbox and GroupDescriptions for that. Those instances that belong to several groups are shown as duplicates (like in Outlook when letter belongs to several categories). But selection of items becomes buggy. Even if ListBox SelectionMode is Single, it is possible to get two different items (not duplicates) to be selected simultaniously. Please use my code example. Launch application Put check into checkbox to apply grouping. Select Potato(Tasty). Select Tomato(Round). Select Potato(Tasty). Select Tomato(Round). Notice that Potato(Tasty) and Tomato(Round) are selected simultaniously.   <Window x:Class="GroupingSample.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Grouping Sample" Width="220" Height="550"> <StackPanel> <TextBlock Margin="12,5,5,0" FontSize="20" Text="My Task List"/> <CheckBox Margin="10,5,5,10" Checked="AddGrouping" Unchecked="RemoveGrouping">Group by task type</CheckBox> <ListBox Margin="10&qu

Multiple Values to the Variable, HOW?

Hi All, I'm trying below query which is working fine:- DECLARE @FULLNAME VARCHAR SET @FULLNAME = 'PQR, ABC L.' SELECT ID FROM TABLE-NAME WHERE LAST_NAME = SUBSTRING(@FULLNAME, 1, PATINDEX('%,%', @FULLNAME) -1) AND FIRST_NAME = LTRIM(RTRIM(SUBSTRING(@FULLNAME, PATINDEX('%,%', @FULLNAME)+1 , PATINDEX('% %', @FULLNAME)))) But when I include two values to the same variable something like this:- DECLARE @FULLNAME VARCHAR SET @FULLNAME = 'PQR, ABC L.', 'LMN, XYZ' SELECT ID FROM TABLE-NAME WHERE LAST_NAME IN SUBSTRING(@FULLNAME, 1, PATINDEX('%,%', @FULLNAME) -1) AND FIRST_NAME IN LTRIM(RTRIM(SUBSTRING(@FULLNAME, PATINDEX('%,%', @FULLNAME)+1 , PATINDEX('% %', @FULLNAME)))) It is giving me error as:- "Incorrect syntax near 'SUBSTRING'." This is because my @FULLNAME will be an SSRS report parameter and which is going to be multi-value parameter. Any Help Please? Thanks Regards, Kumar

SSRS problem with passing multiple parameter values via URL %2c

Hi, I have a problem with passing multiple parameter values from one report (A) to another report (B).   For example I built a URL string in report (A) with the parameters like &Parameter1=1&Parameter1=2. As soon as I click on that URL the URL parameters look like &Parameter1=1%2c2 and the parameters don’t getting populated on report (B).   If I change the parameter in the URL to &Parameter1=1&Parameter1=2 and execute the URL manual the parameter on report (B) getting populated properly.   Is there a way to disable the coding like %2c (comma) or is there another solution for it?   Thanks

How to filter a List View by multiple values for one filter field?

Hi, I need to create a dynamically created link to a List View with a filter on one field, but with multiple values. Example: http://<server>/Lists/<list>/Allitems.aspx?FilterField1=Name&FilterValue1=John/Jack/Jonas which should give me all items where Name equals John, Jack or Jonas. Is this even possible?

Infopath 2007 Repeating Table - Multiple Value Column Text - Hiding Rows based on Column text values

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &

syntax for redirecting multiple values

hi guysi have this code for redirecting one valueResponse.Redirect("contact.aspx?Pat=" + row.Cells(0).Text.Trim()i try doing this Response.Redirect("contact.aspx?Pat=" + row.Cells(0).Text.Trim() & "contact.aspx?Nam=" + row.Cells(1).Text.Trim())but on my landing page it concatenates the 2this is my landing pageProtected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load        PatID.Text = Convert.ToString(Request.QueryString("Pat"))        Patname.Text = Convert.ToString(Request.QueryString("Nam"))so basically it puts everything in my PatID parameterany idead how to pass 2 values????

Storing multiple values in Cookies

I have a page which displays multiple products. Each product has an unique ID. When a user clicks a particular product the description about the product will be displayed in another page. What I want is I have to store the product id's of all recent products visited in a cookie. And I have to show in the same module that these are the products the user visited recently.I tried with cookie, but it stores only a single value(productID).How to store multiple product id's the user visted recently in cookie and how to retrieve it.

using join when a column may have multiple values

Have 2 tables. Table A has among several columns one called "product_code," which contains 4-digit numerals. Table B has just 2 columns, "product_code," the same 4-digit numerals used in the same column in Table A, and "product_description," which includes a VARCHAR string describing the product referenced by the code. I'm querying Table A and trying to include the "product_description" from Table B with each record returned. Am using a LEFT JOIN like this: SELECT  * FROM Table_A LEFT OUTER JOIN Table_B ON Table_A.product_code = Table_B.prod_code This works fine EXCEPT in cases where Table A has more than one value in "product_code," in which case I get no match in Table B and "NULL" is returned for "product_description." When there is more than one value in the "product_code" column in Table A for a particular record, the values are separated by commas (for example: 1002,1003,9856). How can I get this to work so that for records that have multiple produce codes in table A I get multiple product descriptions from Table B?   Thanks      

Any way to pass Multiple Values for a single Label in the Parameter?

  I have a Report that Contains 2 Parameters, @Customer & @Area. When trying to set up the Available Values for @Area, I'm having issues using multiple values for one Label, i.e. = "4006" Or "4610" One of the Filters in the Report is an Operation number, which is the [OPERATION] field, which is setup as a filter on the Tablix referencing the @Area parameter.  PROBLEM: I cannot retrieve any data when trying to use the ‘Or’ Operator here. If I simply put “4006” or “4610” I retrieve data, but when trying to combine it returns no data. Example, I need to allow a user to select ‘Chassis Incoming’, which would include data from Operations 4006 & 4610. QUESTION: Any way to pass Multiple Values for a single Label in the Parameter? I realize the typical solution may be to use ‘Multi-Value’ selection, but in this case we want the User to select the Area and the multiple values for Filtering will be automatically determined for them. Otherwise, they are subject to not getting it correct. I have tried several different ways, such as =”4006” Or “4610”, =(“4006”, “4610”), = In(“4006”, “4610”), etc….   Note: We are using Report Builder 3.0  

Need multiple distinct counts, have 1 fact and 1 dimension

I am using SSAS 2005. I have 1 fact table and 1 dimension. I would like to create multiple distinct counts in 1 Measure group, at least I would like them to appear as in 1 measure group to end-user. I have tried role-playing dimensions, and a roll your own approach that work in limitation but didn't scale. Any help and advice would be great.
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