Skip to content
Advertisement

Get Value in Date Range with date parameter

Given 2 tables:

Table A

Table B

I want to produce the following View:

My Question, how to get Table A Value inside of that view, based on that transaction date within Table A Date From and Date To?

Advertisement

Answer

This query will match each table_a entry to every table_b transaction, based only on the transaction date being BETWEEN datefrom and dateto. table_a.id is ignored.

Output:

db-fiddle here

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement