Advertisement

08.03.2008 at 07:36AM PDT, ID: 23617231
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.7

Query issue - 'Ambiguous column name' and subsequently no output

Asked by PaulyWolly in SQL Query Syntax

Tags: , ,

I have 2 tables, Members and AwardsMember in a Coldfusion 8 project.

AwardsMember
-----------------------------
MemberNumber(blank),
AwardID(data - int),
JBFaward(data - nvarchar)

Members
-----------------------------
MemberNumber(data - nvarchar),
AwardID(blank),
JBFaward(blank)

I want to create a form that opens to show the AwardID, and JBFaward values. I want this form to allow editing of the values, in any field.

Each table currently has MemberNumber fields, but AwardsMember has no data for the MemberNumber field so I cannot use MemberNumber as a relation. Each table has AwardID, and JBFaward. I want to match and fill in all 'data' in AwardsMember.AwardID and AwardsMember.JBFaward with Members.AwardID and Members.JBFaward.

I had an ealier issue where I had multiple values in a field and I need to run a query to match on all entries from 2 different tables. For my similar issue and fix, I show the steps I used below. I tried using the same function/query on my current query design but am getting errors: 'Ambiguous column name 'JBFaward'

This is my current function:
---------------------------
USE [jbbnttt@u]
GO
/****** Object:  UserDefinedFunction [dbo].[GetJBFawards]    Script Date: 08/03/2008 00:47:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[GetJBFawards](@JBFaward nvarchar(255))
RETURNS NVARCHAR(MAX)
AS
BEGIN
 DECLARE @res nVARCHAR(MAX)
 
 SELECT @res = COALESCE(@res + ',', '') + JA.JBFaward
   FROM dbo.AwardsMember JA
  WHERE ',' + replace(@JBFaward, ' ', '') + ',' LIKE '%,' + CAST(JA.AwardID as nvarchar(100)) + ',%'
    AND JA.JBFaward IS NOT NULL
 
 RETURN @res
END

Current query
------------------------
 SELECT    AM.AwardID,  
 CASE WHEN JBFaward IS NOT NULL THEN dbo.GetJBFawards(JBFaward) ELSE 'N/A' END AS JBFaward
 FROM    AwardsMember AM
 JOIN Members Mem ON AM.AwardID = Mem.AwardID
 WHERE    Mem.membernumber = ('#member#')

======================================================

[Previous issue fix]
Function
----------------
USE [jbbnttt@u]
GO
/****** Object:  UserDefinedFunction [dbo].[GetMemberTypes]    Script Date: 08/03/2008 01:26:44 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[GetMemberTypes](@MemberType nvarchar(30))
RETURNS NVARCHAR(MAX)
AS
BEGIN
 DECLARE @res nVARCHAR(MAX)
 
 SELECT @res = COALESCE(@res + ',', '') + MT.MemberType
   FROM MemberTypes MT
  WHERE ',' + replace(@MemberType, ' ', '') + ',' LIKE '%,' + CAST(MT.ID as nvarchar(100)) + ',%'
    AND MT.MemberType IS NOT NULL
 
 RETURN @res
END
 
Query:
-----------------
SELECT    Prof.membernumber,
 Prof.Program,
 Programs.ProgramName,
 Prof.Dues,
 Prof.Term,
 CASE WHEN Prof.MemberType IS NOT NULL THEN dbo.GetMemberTypes(MemberType) ELSE 'N/A' END AS MemberType,
 Prof.status,
 Prof.isgift,
 Prof.giftterm,
 Prof.sourceCode,
 Prof.JoinMethod,
 Prof.Joindate,
 Prof.expirationdate,
 Prof.CompReason,
 Prof.Last_pay_date,
 Prof.CertRedeem
 FROM    Profiles Prof
 JOIN Programs ON Prof.Program = Programs.id
 WHERE    Prof.membernumber = '#member#'

You can see my previous issue for more details:
http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_23546801.html#a21963778Start Free Trial
[+][-]08.03.2008 at 07:43AM PDT, ID: 22147679

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 08:02AM PDT, ID: 22147731

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:01AM PDT, ID: 22147922

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:09AM PDT, ID: 22147944

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:21AM PDT, ID: 22147981

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:25AM PDT, ID: 22147996

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:29AM PDT, ID: 22148010

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:35AM PDT, ID: 22148033

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 11:09AM PDT, ID: 22148301

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 11:43AM PDT, ID: 22148383

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 11:56AM PDT, ID: 22148419

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 12:01PM PDT, ID: 22148443

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 12:14PM PDT, ID: 22148495

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 12:16PM PDT, ID: 22148506

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 12:19PM PDT, ID: 22148515

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 12:25PM PDT, ID: 22148542

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 12:34PM PDT, ID: 22148574

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:00PM PDT, ID: 22148665

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:04PM PDT, ID: 22148675

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:05PM PDT, ID: 22148679

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:07PM PDT, ID: 22148683

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:18PM PDT, ID: 22148709

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:24PM PDT, ID: 22148724

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:41PM PDT, ID: 22148765

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:44PM PDT, ID: 22148777

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:48PM PDT, ID: 22148788

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:48PM PDT, ID: 22148791

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:50PM PDT, ID: 22148801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:52PM PDT, ID: 22148809

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:54PM PDT, ID: 22148816

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:55PM PDT, ID: 22148819

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 01:59PM PDT, ID: 22148828

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 03:43PM PDT, ID: 22149137

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 03:46PM PDT, ID: 22149143

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 04:39PM PDT, ID: 22149253

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 08:56PM PDT, ID: 22149855

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:00PM PDT, ID: 22149863

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 09:18PM PDT, ID: 22149913

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 10:10PM PDT, ID: 22150044

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2008 at 11:52PM PDT, ID: 22150381

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 12:01AM PDT, ID: 22150415

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 12:14AM PDT, ID: 22150461

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 06:46AM PDT, ID: 22152348

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.04.2008 at 06:57AM PDT, ID: 22152425

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Query Syntax
Tags: Microsoft, SQL Server Standard, 2005
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.04.2008 at 07:11AM PDT, ID: 22152565

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628