 |
| SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 10th, 2006, 11:22 PM
|
|
Registered User
|
|
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error: Line 8: Incorrect syntax near '.' ; Help!
Hi everyone,
I have the problem when trying to create a view in MSSQL 2000, this is the code:
Code:
CREATE VIEW vwPreview (WorkFileNo, DateEntry, FirstName, SurName, LoanAmt,IntAmt, Penalty, AdminFees, MOF, Refund, fns, Repayment, IntRebate,PenaltyRebate, RateDiff, Overpayment,Description, ActualBalance
)
AS
SELECT tblClient.WorkFileNo, tblActBal.DateEntry, tblClient.FirstName, tblClient.SurName,
tblDebit.LoanAmt, tblDebit.IntAmt, tblDebit.Penalty, tblDebit.AdminFees, tblDebit.MOF
tblDebit.Refund, tblDebit.fns, tblCredit.Repayment, tblCredit.IntRebate, tblCredit.PenaltyRebate,
tblCredit.RateDiff, tblCredit.Overpayment, tblDebit.Description, tblActBal.ActualBalance
FROM tblClient INNER JOIN tblCredit INNER JOIN tblDebit INNER JOIN tblActBal
ON tblClient.WorkFileNo = tblCredit.WorkFileNo ON tblClient.WorkFileNo = tblDebit.WorkFileNo
ON tblClient.WorkFileNo = tblActBal.WorkFileNo
GO
When I compile this code to get the view, promting the error: Line 8: Incorrect syntax near '.'
Help to resolve this problem. Pls!
Thanks for kindly help!
Think as you're someone else, act as the way you are!
|
|

August 11th, 2006, 08:12 AM
|
|
Authorized User
|
|
Join Date: Jun 2003
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I belive the ON clause should come after every join..
FROM tblClient INNER JOIN tblCredit ON tblClient.WorkFileNo = tblCredit.WorkFileNo INNER JOIN tblDebit ON tblClient.WorkFileNo = tblDebit.WorkFileNo INNER JOIN tblActBal ON tblClient.WorkFileNo = tblActBal.WorkFileNo
|
|

August 15th, 2006, 03:02 AM
|
|
Friend of Wrox
|
|
Join Date: May 2006
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You are missing a comma after tblDebit.MOF.
Rewrite yuor query as this
CREATE VIEW vwPreview
AS
SELECT tblClient.WorkFileNo,
tblActBal.DateEntry,
tblClient.FirstName,
tblClient.SurName,
tblDebit.LoanAmt,
tblDebit.IntAmt,
tblDebit.Penalty,
tblDebit.AdminFees,
tblDebit.MOF,
tblDebit.Refund,
tblDebit.fns,
tblCredit.Repayment,
tblCredit.IntRebate,
tblCredit.PenaltyRebate,
tblCredit.RateDiff,
tblCredit.Overpayment,
tblDebit.Description,
tblActBal.ActualBalance
FROM tblClient
INNER JOIN tblCredit ON tblCredit.WorkFileNo = tblClient.WorkFileNo
INNER JOIN tblDebit ON tblDebit.WorkFileNo = tblClient.WorkFileNo
INNER JOIN tblActBal ON tblActBal.WorkFileNo = tblClient.WorkFileNo
GO
|
|
 |