Parameter between two dates
Hi
I have added the highlighted following syntax but it errors near WHERE can anyone help ?
FROM dbo.INVENTLOCATION INNER JOIN
dbo.SALESTABLE ON dbo.INVENTLOCATION.INVENTLOCATIONID = dbo.SALESTABLE.INVENTLOCATIONID INNER JOIN
dbo.SALESLINE ON dbo.SALESTABLE.SALESID = dbo.SALESLINE.SALESID INNER JOIN
dbo.INVENTTABLE ON dbo.SALESLINE.ITEMID = dbo.INVENTTABLE.ITEMID LEFT OUTER JOIN
dbo.DIMENSIONS ON dbo.SALESLINE.DIMENSION2_ = dbo.DIMENSIONS.NUM
WHERE (dbo.SALESTABLE.DIMENSION = @Region) AND (dbo.DIMENSIONS.DIMENSIONCODE = 1) AND
WHERE (dbo.SALESTABLE.CREATEDDATE) BETWEEN @SDate AND @EDate
Kiwi_Wizz
November 4th, 2010 7:22pm
Two Where Clause... Remove one~~ Mark it as Answer if you find it correct~~
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2010 7:23pm
Hi Sandeep
Yes your right , why cannot you have two WHERE clauses ?
Kiwi_Wizz
November 4th, 2010 7:28pm
Because to add more than one predicate you use the AND keyword rather than adding consecutive WHERE statements... this is by design in the SQL standard.
Free Windows Admin Tool Kit Click here and download it now
November 4th, 2010 7:31pm