What am I missing error codes says:
The dateadd function requires 3 argument(s).
I need to subtract the current date from app_rcpdt, the bold section below.
SELECT t.Doc, ISNULL(COUNT(clmn),0) AS PendinDDS, MAX(Dib_Mvt_Seq_Num) AS MaxSeq1
FROM T2DibPend t
WHERE Dib_Mvt_Typ = 'R' and
LEFT(Org_Id,1) IN ('R','S','V') AND
t.clmn IN (SELECT clmn FROM specnew.dbo.people
WHERE CompleteDt IS NULL) and app_rcpdt - dateadd(dd, getdate())
GROUP BY Doc, app_rcpdt
The dateadd function requires 3 argument(s).
I need to subtract the current date from app_rcpdt, the bold section below.
SELECT t.Doc, ISNULL(COUNT(clmn),0) AS PendinDDS, MAX(Dib_Mvt_Seq_Num) AS MaxSeq1
FROM T2DibPend t
WHERE Dib_Mvt_Typ = 'R' and
LEFT(Org_Id,1) IN ('R','S','V') AND
t.clmn IN (SELECT clmn FROM specnew.dbo.people
WHERE CompleteDt IS NULL) and app_rcpdt - dateadd(dd, getdate())
GROUP BY Doc, app_rcpdt