Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
bhargavikn
Contributor III
Contributor III

Select data interval depending on today date

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

 
DateFromDateToProduct
2019010120190429A
2019043020191120B
2019112120200101C
2020010229991231D
 

After some time the Product values will be changed as below

Date FromDate ToProduct
2019010120190429A
2019043020191120B
2019112120200101C
2020010220200828D
2020082929991231E

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 FromDate ToProduct
2020010220200828D

 

If Today date is 20200920

Output should be as below

Date FromDate ToProduct
2020082929991231E

 

Thanks a lot in advance for your suggestions.

Labels (3)
1 Reply
Kushal_Chawda

@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());