Dear friends,
I have a mysql table that receives the effective data from the workforce on a client of my company.
Each record of the DB has a start date (When this service started to be rendered on that client) and an end date (When this service is no longer rendered.
I need to get the active assets on the client between a x date and a and date.
So long, my SQL resolves.
"SELECT * FROM 'EFETIVO_POSTO' WHERE 'COD' = '$chave' AND 'INICIO' >= '$dataIni' AND 'FINAL' <= '$dataFin'"
The problem is that if this query is performed with today's date, it needs to show the effective amount that exists on that client today, regardless of the date that service started to be rendered.
Ideas are welcome not only in MySQL but also in PHP and even in JS (since this will later generate a JSON to be used by JS)