How to check and get records in a sql using sequelize
I have table with id and createdDate fields
id createdDate
1. 30-6-2023
2. 31-7-2024
I would like to know how to fetch records having createdDate less than one year from today using sequelize
ExpectedRecord
id createdDate
1. 30-6-2023
Tried
return this.findAll({
createdDate: {
between: [new Date(), Date.parse('createdDate
')]
}
});
}