SQL Query on NAV 2013

Hi Everybody

I read this article. And I find it very good with what I need.

https://community.dynamics.com/nav/b/arounddynamicsnavworld/archive/2016/07/27/nav-2013-sql-query-codeunit-tool

 

On SQL Query I edit :

DECLARE
	    @FromDate            DateTime,
        @ToDate              DateTime

SELECT SUM(Quantity) AS QuantityTot, [Item No_], [Location Code], [Lot No_], [Serial No_]
FROM dbo.[CRONUS Italia S_p_A_$Item Ledger Entry]
WHERE [Posting Date] BETWEEN @FromDate AND @ToDate 
AND [Item No_] LIKE '1%'
GROUP BY [Item No_], [Location Code],[Lot No_],[Serial No_]
HAVING ([Location Code]<>” AND (SUM(Quantity)) >0)

 

But when I add the variable I cannot link. Please help me solution.

Thanks so much

 

Parents Reply Children
Related
Recommended