SQL server issue

pts.
Tags:
SQL
The SQL below runs in MS Access, but fails when run in the SQL query analyser. TRANSFORM First(qryWebCustomersAllParents.Parent) AS FirstOfParent SELECT tblCustomers.CustomerID, tblCustomers.CustNameAbbr AS Customer, tblLUBudgetLevels_1.BudgetLevel, qryWebCustomerListCCRMs.CCRMPost, qryWebCustomerListCCRMs.CCRMIncumbent, qryWebCustomerListCCRMs.PostEmailRLIAlias, qryWebCustomerListCCRMs.PostTelephoneVPN FROM qryWebCustomersAllParents RIGHT JOIN ((tblCustomers LEFT JOIN tblLUBudgetLevels AS tblLUBudgetLevels_1 ON tblCustomers.CustBudgetLevelID = tblLUBudgetLevels_1.BudgetLevelID) LEFT JOIN qryWebCustomerListCCRMs ON tblCustomers.CustomerID = qryWebCustomerListCCRMs.CustomerID) ON qryWebCustomersAllParents.CustHierCustomerID = tblCustomers.CustomerID WHERE (((tblCustomers.CustActive)='T')) GROUP BY tblCustomers.CustomerID, tblCustomers.CustNameAbbr, tblLUBudgetLevels_1.BudgetLevel, qryWebCustomerListCCRMs.CCRMPost, qryWebCustomerListCCRMs.CCRMIncumbent, qryWebCustomerListCCRMs.PostEmailRLIAlias, qryWebCustomerListCCRMs.PostTelephoneVPN PIVOT qryWebCustomersAllParents.ParentBudgetLevel In ('TLB','HLB','IHLB','BLB'); In SQL I get: Server: Msg 170, Level 15, State 1, Line 1 Line 1: Incorrect syntax near 'qryWebCustomersAllParents'. Server: Msg 170, Level 15, State 1, Line 16 Line 16: Incorrect syntax near 'PIVOT'. Does SQL Server support the TRANSFORM, First(), GROUP BY and PIVOT keywords? Is there something obvious that would break it for SQL?

Answer Wiki

Thanks. We'll let you know when a new response is added.

1) Does SQL Server support the TRANSFORM, First(), GROUP BY and PIVOT keywords?

First() is part of TRANSFORM syntax.
TRANSFORM and PIVOT do not exist in T-SQL.
GROUP BY does.

2) Is there something obvious that would break it for SQL?

In the BOL / Search for “pivot” you’ll got an example of a cross-tab report.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Juliant
    Thanks for response ebersphi. Have found this helpful too: http://www.ftponline.com/archives/premier/mgznarch/vbpj/2001/10oct01/sqlpro0110/rj0110/rj0110-2.asp
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following