Skip to Content
0

Dynamic date range while connecting from Lumira to SAP

Feb 14, 2017 at 12:06 AM

90

avatar image

Hi -

I am connecting from Lumira to SAP and trying to retrieve some data using SQL (underlying database is Oracle). Everything works fine if I use a hardcoded date value but I need to use a dynamic date in SQL and I do not know how can I get that working. Here's the SQL that is working...

select * from <infosetname> where "infoset.SLFDAT" > DATE'2017-01-01'

My requirement is to get all the records for rolling 3 months and therefore, I need something like...

select * from <infosetname> where "infoset.SLFDAT" > [current date - 90 days]

I am not familiar with the freehand SQL...so, looking for some assistance.

Can someone please help!

Thanks,

Arun

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

2 Answers

Ludek Uher
Feb 15, 2017 at 10:32 PM
0

I think it would be something like:

SELECT count (licences.LICENCEID) FROM licences, product_codes WHERE (LICENCES.STARTDATE <= (SYSDATE)) AND (LICENCES.STARTDATE >= (SYSDATE - (90)))

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Share
10 |10000 characters needed characters left characters exceeded
Arun S Feb 16, 2017 at 03:38 PM
0

Thanks Ludek - No luck so far...!

Here's the actual SQL that works...

Now I changed DATE'2015-12-12' to (SYSDATE) and getting the following error.

What could be other options for me to try?

Arun


img1.png (32.7 kB)
img2.png (18.3 kB)
Share
10 |10000 characters needed characters left characters exceeded