Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

97
Views
Calculate the number of reservations for 1 day

I'm stuck on the calculation of the number of reservations made during the day. People can book up to 4 covers, the capacity of the restaurant is 40 covers. I can't check to see if there's room left. I have a sql query to retrieve the reservations for the day, then I block on the reservations for the days to retrieve the number of covers for each reservation. How do I add the number of covers for all the reservations for the day? I'm going to check this on the backend side with nodejs and express js.

Thank you in advance for your help

exports.createReservation = (req,res)=>{

const {numeroReservation, id_user, idBoutique, horaire, dateReservation, nombreCouverts} = req.body;

 connection.query(reservation.getAllReservationByIdBoutiqueDateReservation,[idBoutique,dateReservation],(error,result)=>{
   for(var i =0,len = result.length; i< len; i++){
            const test = result[i].nombreCouverts * result[i].nombreCouverts
             console.log(test)
             
        }
  }
}

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!