Skip to Content

How can I get value from query selection criteria in SAP B1 query?.

Hi all,

How can I get value from query selection criteria in SAP B1 query?

I want to use month number from selection criteria in calculation of query but I want to use it per row.

How can I get that value?

Please anyone can help me.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 10, 2017 at 11:05 AM

    Hi,

    Yes, this is possible. You can use the sql variable syntax. So for example:

    /* SELECT * FROM ORDR x */
    DECLARE @DATE AS DATETIME
    SET @DATE = /* x.DocDate */ [%0]
    
    SELECT MONTH(@DATE) * 12 AS AStrangeThingToCalculate

    This is again a very simple example, but you can use the @DATE variable in your query in any way you like.

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 10, 2017 at 10:40 AM

    Hi,

    Here is a very simple example:

    SELECT MONTH(T0.DocDate) AS OrderedInMonth
    FROM ORDR T0
    WHERE T0.DocDate = [%0]

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded