How do I use the date range in Progress 4gl

0

I'm making a program to list

  • list client
  • Amount of requests
  • Number of orders per customer

all referring to the month of February, 2015

How would I do to get only the range of

>= 01/02/2015 && <=  28/02/2015 
    
asked by anonymous 13.10.2016 / 18:56

1 answer

0

I saw that you did there in the comment. But using functions that require the value of the table that you are searching for automatically turns the for each into a full table scan, that is, it will not be able to indices in your query. In banks with a large number of orders, this practice plays its performance in the garbage. I would do it this way:

FOR EACH ped-venda WHERE ped-venda.dt-emissao >= 02/01/2015 
     AND ped-venda.dt-emissao <= 02/28/2015 
 BREAK BY ped-venda.nome-abrev BY ped-venda.dt-emissao DESC:

Being the fixed date, as you suggested. This makes Progress use the most appropriate index, greatly speeding up the search result set of your query.

    
13.10.2016 / 20:36