List records between two dates

Hello,

I have a column named “sale_date”, its default value is null, when the product is sold, I enter the date of sale.

sale_date BETWEEN '2018-01-30' AND '2023-01-30'
In this query, sale_date also lists empty rows
How to implement “IS NOT NULL” or something else excluding rows without dates?

Your table holding sale data should only have records in it for sales that have taken place.

You could always try adding AND sale_date IS NOT NULL to the WHERE clause.

1 Like

It is a script to be used by one or two people in the office to follow a simple stock and sales.
This product has a serial number, and the products produced first are recorded with serial numbers. By looking at the serial number of the product sold, the date of sale of the product and to whom it was sold are arranged with the edit icon.
Tthanks for the suggestion

Isn’t it this way? sale_date BETWEEN '2018-01-30' AND '2023-01-30' AND sale_date IS NOT NULL
Thank you

Sponsor our Newsletter | Privacy Policy | Terms of Service