SQL Views from Access queries

  • Thread starter Chris Motherwell via AccessMonster.com
  • Start date
C

Chris Motherwell via AccessMonster.com

I'm converting Access queries to SQL views. A few of the queries return this
error:
Server: Msg 156, Level 15, State 1, Procedure qryTasks, Line 29
Incorrect syntax near the keyword 'AS'. (the query follows)
I don't see why it doesn't like the alias I'm using, since other alias' are
accepted. Does anyone have any ideas?


CREATE VIEW qryTasks
AS

SELECT tblTasks.Task_ID,
tblTasks.InvoiceID,
tblTasks.Task, tblTasks.Associate,
tblAssociates.SE,
tblAssociates.ST,
tblTasks.Job_No, tblTasks.Date,
tblTasks.Hours,
tblTasks.Mileage,
tblTasks.Municipal_Building_Inspector, tblTasks.Details,
tblTasks.Scanned_Docs,
tblTasks.Comments, tblTasks.[Associate's_File_Number],
tblTasks.Photocopies,
tblTasks.Postage, tblTasks.Ferry_Fare,
tblTasks.Prints,
tblTasks.Courier,
tblTasks.Taxi_Fare,
tblTasks.Air_Fare,
tblTasks.Long_Distance_Phone,
tblTasks.Parking,
tblTasks.Vehicle_Rental,
tblTasks.Publications,
tblTasks.Cheque_No,
[Photocopies]*Forms.frmRates.Photocopy_Rate AS CopyAmt, [Mileage]*Forms.
frmRates.Mileage_Rate AS MilesAmt,
tblInvoice.Project_ID,
CASE WHEN tblAssociates.SE=True THEN tblTasks.Hours ELSE 0 AS HoursDM,
CASE WHEN tblAssociates.ST=True THEN tblTasks.Hours ELSE 0 AS HoursOth,
FROM (tblProjects INNER JOIN tblInvoice ON tblProjects.Project_ID =
tblInvoice.Project_ID) INNER JOIN (tblAssociates RIGHT JOIN tblTasks ON
tblAssociates.Associate = tblTasks.Associate) ON tblInvoice.InvoiceID =
tblTasks.InvoiceID
 
S

Sylvain Lafontaine

Probably because you forgot the word "End" at the end of each Case
statements.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top