.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Derived Column & Lookup

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :Sql Server
 

I have a derived column (MyNewID) that strips off the data I require like this:

SUBSTRING(ID,FINDSTRING(ID,"-",1) + 1,LEN(ID))

This leaves me with a string that would look similar to 12345 (or whatever my ID is). What I need to do now is use MyNewID column to perform a lookup from a another table. I have tried using the the lookup, but can;t find a way to passw my new derived column's value into my Lookup's SQL query (which looks something like this:

 select Field1, Field2
 from tblSales s
 where s.SaleID = (this is where my parameter/derived column needs to be)

Is there a way to pass the value through somehow?  Am I using the right method to do this?




View Complete Post


More Related Resource Links

BDC Entity as a Data Source for a Lookup column

  
Is it possible to create a custom lookup field type to have a BDC entity as the data source?

wss2.0 update/delete/hide lookup column that does not display any values

  

Hi All,

I have a document library that contains a Category column that is a lookup field. This is a default column that is a required field when uploading documents to the document library. The Category column is empty and I am unable to amend, hide, make it not required or delete it.

I have gone to Modify settings and columns -> clicked on the Category field to edit, but there is no option to amend the content or delete it. I am only able to amend the Column name and Description.

Since then, I have amended the column name to eg. Category1 and created a new Category field as a lookup and linked it to the correct list.

The problem I am facing now, is that I cannot hide, delete or make the Category1 (old Category) field NOT required. Either I would like to update the original field to display the correct values or alternately hide, delete or make the column not required.

Please help.


Datasheet view lookup column issue

  

When a column that has a lookup is empty in datasheet view and I attempt to update a different column I get this message: the text entered for isn't an item from the list. select an item from the list, or enter text that matches one of the listed items.

I found this hotfix, but it did not apply.

http://support.microsoft.com/kb/948952

Any ideas how to get this resolved?


How to recover from Derived Column Transformation Editor corrupting table metadata?

  
Hi there, In attempting to use the DCTE to replace the value in a field with a trimmed version (SSN = trim(SSN)), it seems that my meta-data has become corrupted by the Derived Column drop-down list. As a result, #1: I no longer see my incoming SSN field in the "columns" tree, and any reference to it is deemed "invalid", even though it's value does make it out of the Data Transformation process. How can I get back the reference to this field without redoing this entire task? And, #2: in the process, DCTE created new columns with "SSN" prefixed by the task name, such as "trim character fields.SSN". How can I delete these? It seems that one slip of the mouse in this form can lead to irreversible corruption of the meta-data, which the "debugger" then references and uses to "invalidate" subsequent work. I have tried everything I can think of to refresh this, including using the "Advanced Editor" and reloading the entire package. Any ideas? Thanks, Karl Kaiser

Efficiency: new column in source query or derived column task?

  
Hi All, I've just started working on an SSIS package that pulls data from an OLE DB Source by a query. A new column needs to be added based on the value of a queried column. I was wondering if it's better to do that in the query or with a derived column? A simple example: I have a table that contains CustomerName and CustomerCode (this one can be V /valid/ or I /invalid/). I need to store the CustomerCodeDesc in a separate column in the destination table. Is it better to alter the query like this: SELECT CustomerName, CustomerCode, CASE WHEN CustomerCode = 'V' THEN 'Valid' ELSE 'Invalid' END AS CustomerCodeDesc FROM CustomerTable Or is it better to use a DerivedColumn task in the DataFlow? Or maybe it doesn't really matter...

Problem while retrieving data from a lookup column from sharepoint linq.

  
Hi I am working with sharepoint linq concept. When I am giving a query with lookup column It's working fine.  But when i am trying to retrieve the data from a look up column to spgridview. I was unable to get the output. Here is the above code which i have worked.   string strTitle = string.Empty; string strStatus=string.Empty; var context = new LinqSampleDataContext(SPContext.Current.Web.Url); EntityList<SharePoint2010ConceptsItem> Concept = context.GetList<SharePoint2010ConceptsItem>("SharePoint 2010 Concepts"); var query = from cs in Concept where cs.Status.Title.ToString()!="Completed" select new { cs.Title, cs.Id, //cs.Status }; sgvConcepts.DataSource =query; sgvConcepts.DataBind();   Any help me plz how to retrieve the data from a lockup column.bvnprasad

Problem with Retrieving data from lookup column using SharePoint 2010 Linq Concept

  
Hi I am working with sharepoint linq concept. When I am giving a query with lookup column It's working fine.  But when i am trying to retrieve the data from a look up column to spgridview. I was unable to get the output. Here is the above code which i have worked.   string strTitle = string.Empty; string strStatus=string.Empty; var context = new LinqSampleDataContext(SPContext.Current.Web.Url); EntityList<SharePoint2010ConceptsItem> Concept = context.GetList<SharePoint2010ConceptsItem>("SharePoint 2010 Concepts"); var query = from cs in Concept where cs.Status.Title.ToString()!="Completed" select new { cs.Title, cs.Id, //cs.Status }; sgvConcepts.DataSource =query; sgvConcepts.DataBind();   Any help me plz how to retrieve the data from a lockup column.bvnprasad

MOSS 2007: list column that lookup to multiple documents stored in doc library

  
Hi All, I'm trying to understand how to customise MOSS to achieve the following: I need to lookup from a list to multiple documents stored in a documetn library. Example: - List item 1 --------> Lookup to Doc 2                   --------> Lookup to Doc 5 - List item 2 --------> Lookup to Doc 3                   --------> Lookup to Doc 5                   --------> Lookup to Doc 8 - List item 3 --------> Lookup to Doc 1 How can I achieve this? is it possible that in the lookup I have a "search" option? Thanks all Vit

Using derived column for calculations

  
Hi Guys, Im trying to calculate a value using a derived column. I have this following recordset in my data flow. C1 C2 ITM 88 ITM 10 TX 52.45 DC 92.18 I have this formula: 1. DC = (DC- TX) * 1.12 So the result would be like this. C1 C2 ITM         88.00 ITM         10.00 TX         52.45 DC         44.50 Thanks,  

Paste data in a lookup column

  
Hi all, I am trying to create a Sharepoint list from a previous Excel file and I would like to use a lookup column, to allow users to pick values of “column B” from “column A”. The values are already entered in "column A", so now I would like to edit the list in datasheet view and copy/paste the values from my excel file into my “column B”. It works well when I copy/paste only one data, but when I try to paste several values in the same row (using a semicolon as delimiter), I get the error message “Cannot paste the copied data due to data types mismatches or invalid data.”, although the column is set to allow multiple values. I noticed that lookup columns allowing mulitple values store items with the item ID, as follows: ITEM NAME;#ITEM ID, but don’t display it in datasheet view or standard view, and I guess this is why I can’t copy and paste the data from my excel file since they don’t have the ID encoded, but is it possible to do it anyway? Thanks for your help.

Unable to load data into a LookUp column in sharepoint using sharepoint destination

  
I have loaded details of a customer on a list and was able to load the data with out any problem using sharepoint list destination. We have a lookup column called customerid looking at customer list  . This lookup column is in another list, called Customer Main, so I am trying to load additional data for customer in this customer Main  list which contains a lookup column called customerID. I was not able to load data into this cutsomerid, whereas rest of the data is coming into sharepoint with out any problem. How should I load data into a lookup column. Thanks  

Lookup column in the list

  
I have one list on SharePoint. I want to create another list and one of the columns should pick up values from the other list. However, when I create a new column and select the type as "Lookup (information already on this site) and select my old list in "Get Information from" , I don't see all the columns of the old list but a selected few. Why is that and how can I make sure that in my lookup column in the new list, I see all the columns as I need information from the other columns?

Lookup column output includes strange characters.

  
Hi all, I have a lookup column ("Priority"), that returns a number, which it looks-up from a different list (obviously). I have a workflow that emails the user when the list item is created, and in that email I have included the Priority field. However, the email is showing the contents of the Priority field along wth other characters - an example is: The column in the list says 3 The column in the email says 3;#3 What's going on? Why is it adding the additional characters to it? I'm not sure where it's coming from? This only seems to happen where a lookup column contains a number. Thanks in advance. Duncan

Copy of dispForm.aspx and lookup column

  
Hello, we have created in SPD 2010 a new Dispform. This new dispformuser.aspx is the new default form for viewing list entries. We want to hide some elements with jquery. We are using some lookup columns in our list. When we open an entry in the new form, the lookup-columns looks like <a href="http://s-sharepoint-02.kkrn.local/_layouts/listform.aspx?PageType=4&ListId={1D8EE013-E164-482F-861E-9CACB2EBF6B5}&ID=1&RootFolder=*">Marien-Hospital</a> The form is not customized at the moment, it is only a copy at the moment. Any other colums are ok. Editform and newform seems to be ok, also the lookup columns. Maybe somebody can help us with this behaviour.  thank you Regards Marc

restrictions on additional columns available for addition with Lookup column?

  
Can a choice column be added as an additional field when creating a Lookup column? I was able to do this in the beta version but have been unable to in RTM. The column does not appear in the list of availabe columns to add as additional fields.

supported column types that can be used as additional fields with a Lookup column?

  
Can anyone tell me which types of columns can be used as additional fields for a Lookup column? Are they the same as the column types that can be used to create Lookup columns? Choice columns are currently not available (known issue) but I think they are officially supported. What about Managed Metadata columns? Thanks

Lookup column uses ID instead of Title in rule formula

  
I have two SP lists: Partner and Request. Partner just has a Partner Name column, plus the ID column. In Request, I have a lookup column pointing to the Partner list. There is also a Title column and a Request Date column. When I set up the lookup I set it to get info from the Partner list’s Partner Name column, not the ID column.   I made an InfoPath form to make a new Request, with the Partner being selected from a Drop-Down List Box. When this form is submitted, I would like to change the Title field to be a string concatenation of Partner Name, a comma, and the Request Date. I made a rule to do this. Example of what I want: “Partner A, 8/27/2010”.  However, the result is that the Partner ID is used instead of the Partner Name and what I get is “1, 8/27/2010”.   (More: In production I would use the Form Submit rule to do this. For development I used a rule that runs when the field changes. If I change the Drop-Down List Box properties Value property (on the data tab) from d:ID to d:Title the string is formatted as desired, but the form won’t submit and shows a tooltip that only positive integers are allowed.)   How can I make the rule use the Partner Name column in the formula for the rule, instead of the ID?   Thank you, James.
Categories: 
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