How to filter active client list in a given period

Asked

Viewed 210 times

1

Good morning everyone. I am developing a management software for a home care company. I have a list of clients who may be active or inactive within a month. Each customer has a contract value with the company and costs it generates in each month. To calculate the company’s net profit within a given month I managed a scaffold for month. I need each month to get the list of active customers in that period, how can I do that? A query to customers with condition = active within a certain period? Thank you to anyone who can help.

  • What defines a customer as "active"? Any invoice saved in another table for a given month?

  • I think you should create at least one "last access" column, and whenever the guy performs an action on the system, or at least every 10 minutes check on the system if it stays online update the "last access" date, in the SQL search filter for you to view, just bring the records where the date is longer or shorter than the period you want to put limit

  • 1

    The question is from @Cleber Griff , what is an "active customer" without knowing it is not enough to say anything.

  • That, @Motta! I imagined that an "active" customer would be a customer that has some invoice created in a certain period. If that is the case, it would simply execute a query in the style WHERE datafatura BETWEEN data_inicial AND data_final

  • Speak guys. Active customer is the customer who pays monthly. In the case of this company customers become inactive because they die kkkk. Summarizing I need to add up the monthly fees of active customers and subtract the costs generated with that same customer to reach the net profit. The net profit of the month is the sum of the net profit of each ACTIVE customer, so I need to know how to filter active customers in January, February, etc.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.