I have a prisma query that groups by dueDate: ```...
# orm-help
b
I have a prisma query that groups by dueDate:
Copy code
const data = await prisma.customer.groupBy({
        by: ['dueDate'],
        where: {
            status: {
                in: 'PAID',
            },
            merchantId: 1
        },
        _sum: {
            balancePaid: true
        },
        orderBy: {
            dueDate: 'asc'
        }
    })
And this is a sample of the return:
Copy code
[
    {
        "dueDate": "2021-11-01T06:30:26.387Z",
        "_sum": {
            "balancePaid": 27337.94
        }
    },
    {
        "dueDate": "2021-11-01T09:26:17.966Z",
        "_sum": {
            "balancePaid": 4320.82
        }
    },
    {
        "dueDate": "2021-11-01T09:43:23.207Z",
        "_sum": {
            "balancePaid": 50684.73
        }
    },
    {
        "dueDate": "2021-11-01T10:10:48.072Z",
        "_sum": {
            "balancePaid": 65238.76
        }
    },
Is there a way to trunc the dates prisma without having to do a raw query? Or is that not possible? I would like to be able to group by date without a specific time getting in the way.
r
@Britt Danzer 👋 Unfortunately not, you would need to use a raw query to work with truncated dates. It would be great if you could add a 👍 to this feature request so that we can know the priority for this 🙂