Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| Search | Today's Posts | Mark Forums Read
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
 
Old August 10th, 2006, 11:22 PM
Registered User
 
Join Date: Jul 2006
Location: Hanoi, Hanoi, Vietnam.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Fly4High Send a message via Yahoo to Fly4High
Default 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!
 
Old August 11th, 2006, 08:12 AM
Authorized User
 
Join Date: Jun 2003
Location: , , Norway.
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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




 
Old August 15th, 2006, 03:02 AM
Friend of Wrox
 
Join Date: May 2006
Location: Helsingborg, , Sweden.
Posts: 246
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect Syntax Error. binici ASP.NET 2.0 Basics 2 January 12th, 2007 01:33 AM
Line 1: Incorrect syntax near ')'. how to fix it khaink ASP.NET 1.0 and 1.1 Basics 1 September 20th, 2006 06:20 AM
Line 1: Incorrect syntax near '1'. martin1 Visual Basic 2005 Basics 1 June 26th, 2006 01:06 PM
Line 6: Incorrect syntax near garrydawkins SQL Server 2000 2 April 10th, 2006 03:39 PM
Error Line 1: Incorrect syntax near '='. Calibus Classic ASP Databases 9 July 20th, 2004 02:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.