Hi <@U03RJ4VCJGJ> :wave: if you want to query by ...
# orm-help
r
Hi @Vu Duong 👋 if you want to query by a single day (like 2006-01-23) or any other time frame, instead of a very specific time (like 2006-01-23T190000.000Z) you need to use a combination of
gt/gte
and
lt/lte
. For example.
Copy code
let result = await prisma.post.findMany({
    where: {
      updatedAt: {
        gte: '2020-03-19T00:00:00+00:00',
        lte: '2020-03-19T23:59:59+00:00'
      }
    }
  })
👍 1
v
@Raphael Etim I want to retrieve date only when get date of birth from the database. Currently, Prisma only allow me get Javascript date object. Eg: my birthdate is
'2000-10-10'
in the database and I get it
2000-10-10T00:00:00.000Z
from Prisma.
r
The issue which you referenced is still open and support for returning date only column as plain string is not available yet. However another workaround could be through the use of queryRaw with this SQL
Copy code
SELECT * FROM "Customer" WHERE "id" = 2 AND EXTRACT(MONTH FROM "dateOfBirth") = 3 AND EXTRACT(DAY FROM "dateOfBirth") = 14
1
v
Thanks for your support @Raphael Etim
💚 1
r
You're welcome.