1 (edited by chartcatuser 2022-07-10 03:29:49)

Topic: Help please!

There are 4 tables:
Help with the selection of records..
I need the report to contain all records for example from 1.07 -10.07 that have the status in checkbox =1 and for each ID the price was calculated in just 10 days.
bsm_off table:
cost - price
inn - qty
date - date
id_employees - person id
id_orderproduct - order id
(the checkbox status is bsm_off.Vidano)
All products id_employees for a month are recorded in this table, but the selection must be made based on the status of combobox =1

How to make a request correctly, I've been suffering for a month, I've tried everything sad

I would like to see this in the report:
lastname total for the period
Mark 350
Sam 652
Max 1150

Post's attachments

Attachment icon Безымянный-1.png 1.3 mb, 27 downloads since 2022-07-10 

2 (edited by chartcatuser 2022-07-10 03:37:28)

Re: Help please!

I got something like, but I don’t know how to Display all id_employees records from the bsm_off table for a certain period and so that it includes the checkbox bsm_off.Vidano
Select employees.employees.lastname,
   Total(bsm_off.cost),Total(bsm_off.inn),
   
   Total((bsm_off.cost * bsm_off.inn))
From bsm_off
Left Join employees On employees.id = bsm_off.id_employees
Left Join orderproduct On orderproduct.id = bsm_off.id_orderproduct
Group By bsm_off.orderproduct

Re: Help please!

It's hard trying to create a report without the data. But have you tried having where clause?

Select employees.employees.lastname,
   Total(bsm_off.cost),Total(bsm_off.inn),
   
   Total((bsm_off.cost * bsm_off.inn))
From bsm_off
Left Join employees On employees.id = bsm_off.id_employees
Left Join orderproduct On orderproduct.id = bsm_off.id_orderproduct
WHERE bsm_off.Vidano = 1
Group By bsm_off.orderproduct
brian

4 (edited by chartcatuser 2022-07-28 12:10:40)

Re: Help please!

brian.zaballa wrote:

It's hard trying to create a report without the data. But have you tried having where clause?

Select employees.employees.lastname,
   Total(bsm_off.cost),Total(bsm_off.inn),
   
   Total((bsm_off.cost * bsm_off.inn))
From bsm_off
Left Join employees On employees.id = bsm_off.id_employees
Left Join orderproduct On orderproduct.id = bsm_off.id_orderproduct
WHERE bsm_off.Vidano = 1
Group By bsm_off.orderproduct

Thanks for the tip.