Hello, I have a SQL query example, I need to perfo...
# orm-help
d
Hello, I have a SQL query example, I need to perform in Prisma Example:
Copy code
SELECT * FROM table1 
WHERE '2011-01-01' BETWEEN table1.startdate AND table1.enddate
How I can perform this operation in Prisma ?
👀 1
t
I think you’re trying to do this…. docs here would look something like
Copy code
const result = await prisma.post.findMany({
  where: {
    AND: [
       date_created: {
         gte: new Date(startdate)
       },
       date_created: {
         lte: new Date(enddate)
       },
    ]
  },
})
fyi, I don’t work for Prisma so might not be the best answer.
🙌 1
d
Thank you @Tyler Bell 🙂