note
jonadab
<blockquote><code>declare @RepDate datetime</code></blockquote>
<p>Don't you need a semicolon after this declaration?</p>
<blockquote><code>select @RepDate = max(Date) from CRRWarehouse..AERReportDate where Date >= '1 jan 2008' and [User] like '%SYS%'</code></blockquote>
<p>Don't you need a semicolon after this SELECT statement?</p>
<p>Also, in general, if you're getting an error in your SQL, I would suggest executing just one SQL statement at a time so that you can easily identify which one has the error in it.</p>
<div class="pmsig"><div class="pmsig-230012">
<div>-- </div>
<div>We're working on a six-year set of <a href="http://bibleschoolmaterials.blogspot.com/">freely redistributable Vacation Bible School materials</a>.</div>
</div></div>
726059
726059