Skip to content
Advertisement

SQL selecting data between particular date and additional field filter

I have the a sql table payments with the following columns:

And here is some values

Now I need to fetch select the data based on payment_date and status where sometimes the payment_date can be a range or the same date.

Scenario 1:

Should return:

Screnario 2:

Should return:

Any work around this?

Advertisement

Answer

As @strawberry suggested use time as well with date to fetch the data

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