Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
We have requirement to load Product data depending on today date from data base. could you please help me with the suitable where condition.
Scenario:
We have DateFrom, DateTo and Product as below
DateFrom | DateTo | Product |
20190101 | 20190429 | A |
20190430 | 20191120 | B |
20191121 | 20200101 | C |
20200102 | 29991231 | D |
After some time the Product values will be changed as below
Date From | Date To | Product |
20190101 | 20190429 | A |
20190430 | 20191120 | B |
20191121 | 20200101 | C |
20200102 | 20200828 | D |
20200829 | 29991231 | E |
Need:
We need to load the Product and Date range depending on today date.
If Today date is 20200420
Output should be as below
Date From | Date To | Product |
20200102 | 20200828 | D |
If Today date is 20200920
Output should be as below
Date From | Date To | Product |
20200829 | 29991231 | E |
Thanks a lot in advance for your suggestions.
@bhargavikn try below where condition while loading data. assuming your dates are in proper date format. if not first convert it into proper date format then try where condition on resident load
where floor(DateTo)>=floor(today()) and DateFrom<=floor(today());