Advertisement

06.29.2006 at 10:32AM PDT, ID: 21903802
[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.2

clean up this syntax???

Asked by ironpen45 in MS SQL Server

Tags: , ,

when i check the syntax for the following sp, i keep getting:

"Error 156: Incorrect syntax near the keyword 'As'"

and it doesn't give me the line number. i cleaned this up a bit, to no avail. please help!

========================
CREATE PROCEDURE sp_GetClientSummary (@intClientID Int, @intVendorID Int) AS

SELECT [PtblAccounts].[AddlBilling],
Case when [PtblAccounts].[CD]<>0 THEN "E-Media" End & " " &
Case when [PtblAccounts].[CSR]<>0 THEN "CSR" End & " " &
Case when [PtblAccounts].[PaperBill]<>0 THEN "Paper Bill" End & " " &
Case when [PtblAccounts].[Spreadsheet]<>0 THEN "Spreadsheet" End & " "
AS DataSource,

[PtblClients].[ClientID],
Case When [PtblVendor].[VendorID] Is Null Then [PtblVendor_1].[VendorID] Else [PtblVendor].[VendorID] End As XVendorID,
[PtblClients].[MasterClientID],
[PtblClients].[ClientName] AS MasterClient,
[PtblClients].[ClientName],
Case When [PtblVendor].[VendorID] Is Null Then [PtblVendor_1].[Vendor] Else [PtblVendor].[Vendor] End As XVendor,
Case When [PtblAccounts].[AccountNumber] Is Null Then [PtblcOrderedAccounts].[AccountNumber] Else Case When
[PtblAccounts].[AccountNumber]<>[PtblcOrderedAccounts].[AccountNumber] Then [PtblcOrderedAccounts].[AccountNumber] End As XACCOUNT,
Count(*) As N,
[PtblAccounts].[TotalTelecommExpense],
Case When [PtblcOrders].[SummaryAccount] Is Null Then [PtblcOrderedAccounts].[SummaryAccount] Else
[PtblcOrders].[SummaryAccount] End AS XSUMMARYACCOUNT,
FROM PtblClients LEFT JOIN PtblAccounts ON [PtblClients].[ClientID] = [PtblAccounts].[ClientID] LEFT JOIN PtblcOrderedAccounts
RIGHT JOIN PtblcOrders ON [PtblcOrderedAccounts].[OrderID] =[ PtblcOrders].[OrderID] ON [PtblClients].[ClientID] = [PtblcOrders].[ClientID]
LEFT JOIN PtblVendor ON [PtblAccounts].[VendorID] = [PtblVendor].[VendorID] LEFT JOIN PtblVendor AS PtblVendor_1 ON
[PtblcOrders].[VendorID] = [PtblVendor_1].[VendorID]
GROUP BY [PtblAccounts].[AddlBilling],
Case When [PtblAccounts].[CD]<>0 THEN "E-Media" End & " " &
Case  When [PtblAccounts].[cSR]<>0 THEN "CSR" End & " " &
Case  When [PtblAccounts].[PaperBill]<>0 THEN "Paper Bill" End & " " &
Case  When [PtblAccounts].[Spreadsheet]<>0 THEN "Spreadsheet" End ,
[PtblClients].[ClientID],
Case When [PtblVendor].[VendorID] Is Null Then [PtblVendor_1].[Vendor] Else [PtblVendor].[Vendor] End,
Case When [PtblAccounts].[AccountNumber] Is Null Then [PtblcOrderedAccounts].[AccountNumber] Else
[PtblAccounts].[AccountNumber]<>[PtblcOrderedAccounts].[AccountNumber] Then [PtblcOrderedAccounts].[AccountNumber],
PtblAccounts.TotalTelecommExpense,
Case When [PtblcOrders].[SummaryAccount] Is Null Then [PtblcOrderedAccounts].[SummaryAccount] Else
[PtblcOrders].[SummaryAccount],
HAVING PtblClients.ClientID = @intClientID And XVendorID = @intVendorID

GO

===================Start Free Trial
[+][-]06.29.2006 at 10:34AM PDT, ID: 17011680

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: MS SQL Server
Tags: incorrect, near, syntax
Sign Up Now!
Solution Provided By: rafrancisco
Participating Experts: 3
Solution Grade: B
 
 
[+][-]06.29.2006 at 10:39AM PDT, ID: 17011738

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

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

 
[+][-]06.29.2006 at 10:42AM PDT, ID: 17011781

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.

 
[+][-]06.29.2006 at 10:44AM PDT, ID: 17011807

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.

 
[+][-]06.29.2006 at 10:51AM PDT, ID: 17011876

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.

 
[+][-]06.29.2006 at 10:52AM PDT, ID: 17011879

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.

 
[+][-]06.29.2006 at 10:56AM PDT, ID: 17011909

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.

 
[+][-]06.29.2006 at 11:41AM PDT, ID: 17012291

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.

 
[+][-]06.29.2006 at 11:49AM PDT, ID: 17012346

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.

 
[+][-]06.29.2006 at 11:51AM PDT, ID: 17012359

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.

 
[+][-]06.29.2006 at 11:55AM PDT, ID: 17012392

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.

 
[+][-]06.29.2006 at 11:57AM PDT, ID: 17012410

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.

 
[+][-]06.29.2006 at 11:59AM PDT, ID: 17012421

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.

 
[+][-]06.29.2006 at 12:05PM PDT, ID: 17012474

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.

 
[+][-]06.29.2006 at 12:08PM PDT, ID: 17012507

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.

 
 
Loading Advertisement...
20081112-EE-VQP-42