Home Forums SQL Server 2005 Administering "Incorrect syntax near 'AS'. Expecting ID, '(', or PRIMARY" RE: "Incorrect syntax near 'AS'. Expecting ID, '(', or PRIMARY"

  • Thanks will in future,I did finish the join and put in alias but I'm getting two errors:1 next to alias h I the following error "An expression of non-Boolean type specified in a context where a condition is expected:

    2 next to the WHERE clause "Incorrect syntax near 'WHERE"

    Select

    a.ApplicantName

    ,a.ApplicationUniqueNumber

    ,a.MeetingDate as DateOfApproval

    ,a.ProjectSICDescription as Sector

    ,b.Description as Product

    ,a.Province

    ,a.Investment

    ,a.GrantAmount

    ,g.FIG

    ,dbo.fn_ProjectSize(c.TotalIncentive)as ProjectSize

    ,d.status

    ,dbo.fn_GetProjectJobsNew(e.id) as NewJobs

    ,dbo.fn_GetProjectJobsExisting(e.ID) as JobsExisting

    ,(f.BFemale +f.CFemale + f.DFemale +f.IFemale + f.OFemale + f.WFemale) AS NumberOfFemales

    ,(f.BMale + f.CMale + f.DMale + f.IMale + f.OMale + f.WMale) as NumberOfMale

    from ApplicationApprovalsList a inner join

    ProductDescriptionForApproval b on a.Id= b.ApplicationHeaderId inner join

    ApplicationHeader c on c.Id = b.ApplicationHeaderId inner join

    AppStatus d on d.id = c.Status inner join

    Project e on e.ApplicationHeaderId = c.Id left join

    ProjectEmployment f on f.ProjectId = e.Id left join

    Budget g on g.ProjectId = e.Id left join

    ( select sh.Description from ShareHolder sh ) As h

    WHERE (c.AcknowledgeDate BETWEEN CONVERT(DATETIME, '2012-07-01 00:00:00', 102) AND CONVERT(DATETIME, '2012-09-30 00:00:00',

    102))