```export async function getUserEventsQuery(   web...
# orm-help
h
Copy code
export async function getUserEventsQuery(
  website_id,
  start_at,
  end_at,
  day,
  monthClean,
  weekClean,
  yearClean,
) {
  console.log(typeof monthClean);
  return runQuery(
    prisma.$queryRaw`
    SELECT g.groupevent_id, g.groupevent_name, g.objectif, g.periode_objectif, g.event_type, g.event_value, COUNT(e.groupevent_id) AS resultat,
    CASE  g.periode_objectif
         WHEN 'Jour' THEN((COUNT(e.groupevent_id) / ${day}) * 100 / g.objectif)
         WHEN 'Mois' THEN((COUNT(e.groupevent_id) / ${monthClean}) * 100 / g.objectif)
         WHEN 'Semaine' THEN((COUNT(e.groupevent_id) / ${weekClean}) * 100 / g.objectif)
        WHEN 'Année' THEN((COUNT(e.groupevent_id) / ${yearClean}) * 100 / g.objectif)
    END as rate
    FROM groupevent as g 
    
       LEFT JOIN event e
          ON g.groupevent_id = e.groupevent_id
             AND e.created_at between ${start_at} AND ${end_at}
    WHERE g.website_id=${website_id} 
    GROUP by g.groupevent_id
    ORDER BY  resultat DESC ;
    `,
  );
It doesnt work on prisma.queryRaw because of monthClean, weekClean, yearClean being a float number, i checked on internet and they say it doesnt work on queryRaw, so i need to "the normal way" to see if it works like that too