Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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!
Reply With Quote
  #2 (permalink)  
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




Reply With Quote
  #3 (permalink)  
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:05 AM.


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