The date entered by the user is to check whether the date is between or exists between the start_Date column and the end_Date column of the MySQL database. Using NodeJS
P粉5471709722024-03-31 20:45:48
If you use Sequelize for this type of query, you can use the Op.gte
and Op.lte
operators to achieve these two comparisons:
const records = model.findAll({ where: { start_Date: { [Op.lte]: date }, end_Date: { [Op.gte]: date }, } })