PT Sterling Tulus Cemerlang
www.sterling-team.com

Phone
+62-877-8655-5055
+62 (21) 580-6055

Email
sales-enquiry@sterling-team.com

Address
Sampoerna Strategic Square
South Tower 18th
Jl Jend. Sudirman kav 45-46
Jakarta 12930 - Indonesia

How to Use Custom Parameter on Query Manager

SAP Business One Tips Custom Parameter on Query Manager

With Query Manager on SAP Business One, not just a select syntax, you can also use a selection criteria, and added to your custom query. Here is a simple query sample with a date criteria parameter.

With a [Date From] – [Date To] on OINV Table

declare @FromDate date
declare @ToDate date

set @FromDate = ‘2019-01-01’
set @ToDate  =’2019-01-31’

SELECT * FROM OINV
WHERE DocDate >= @FromDate
AND DocDate <= @ToDate

So, you need to change that query, to be like query below:

/*SELECT * FROM OINV TO*/

declare @FromDate date
declare @ToDate date

/* WHERE */

set @FromDate = /* T0.DocDate */‘[%0]’
set @ToDate =/* T0.DocDate */ ‘[%1]’

SELECT * FROM OINV
WHERE DocDate >= @FromDate
AND DocDate <= @ToDate

That’s it, you can try to use that basic composition for declare the variable and use selection criteria on your custom query on Query Manager feature.


This article was written by PT. Sterling Tulus Cemerlang, SAP Business One GOLD Partner in Indonesia.
More details about SAP Business One,
email to: sales-enquiry@sterling-team.com or call +6221-5806336 or wa +6287786555055

, , ,