Skip to Content
0

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

Apr 10, 2017 at 10:30 AM

179

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Johan Hakkesteegt Apr 10, 2017 at 11:05 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

This is exactly what I wanted. Thank you so much Johan.

1
Johan Hakkesteegt Apr 10, 2017 at 10:40 AM
0

Hi,

Here is a very simple example:

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

Regards,

Johan

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Johan,

Yes, but I want to take month from [%0] and use it in calculation of each row in query.

Is it possible?.

0