I am working in SQL 2005 (I think), SQL Query Analyzer Version SQL 8.00.760.
I would like to write a query that returns a count into a Crystal Report from a table only if the due date exceeds 14 days based on the end date in the report search. Based on my very limited understanding of SQL, I have come up with the following, which has proven to be wrong. Please help me redo or refine this statement.
Select
T.NextDueDate
From
Task_ConditionAssessment T
begin
IF DATEDIFF(dd,T.NextDueDate,@enddate)>14
Count(*)
end
Again, this is not correct, but I am unsure what should be done differently....the error returned was Line 5: Incorrect syntax near 'count'.
Thanks in advance.