Hi Experts,
When I create the derived table, I got this error message.
Exception: DBD, [Microsoft][ODBC SQL Server Driver]Communication link failureState:08S01
But I can run the query in SQLServer management Studio successfully.
What kind of syntax I should follow?
The following is the script:
select INV. docdate as 'Date', sum(INV.doctotal) as 'Total' from OINV INV
where INV.docdate >= dateadd(day, -14,convert(date,getdate())) and INV.docdate < dateadd(day, 1,convert(date,getdate()))
group by INV.docdate
union
select CR.docdate as 'Date', sum(CR.doctotal*-1) as 'Total' from ORIN CR
where CR.docdate >= dateadd(day, -14,convert(date,getdate())) and CR.docdate < dateadd(day, 1,convert(date,getdate()))
group by CR.docdate
Derived table cannot recognize dateadd() ?
Thanks,
Christina