Joonatan
06/15/2022, 1:51 PMSELECT * FROM "Example" WHERE "date" > '2020-10-10'
it works fine. But how to pass the date as variable?
I have tried it like this:
_let_ fromStr = dayjs(from).format("YYYY-MM-DD");
`Prisma.queryRaw`SELECT * FROM "Example" WHERE "date" > '${fromStr}'`` and also without the single quotes but it throws “ERROR: invalid input syntax for type date: \“$1\“” each timeAustin
06/15/2022, 9:39 PMfrom
variable an instance of Date
? In that case, try passing it directly into the raw query and let me know if it works.Joonatan
06/20/2022, 10:10 AM