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.
Also read relevant SAP Business One Tips:
- Understanding the “Consider Reconciliation Date” Checkbox in General Ledger
- Create a Cube Using Query in SAP HANA (Part 1)
- Print Login User Name in SAP B1 Crystal Report
- Create Cube with Query in SAP HANA (Part 2)
- How to Create UDO Template for SAP B1 Data Import
- How to Use Can Grow in Crystal Report SAP B1








