Consultor Eletrônico



Kbase P12497: RESULTS can not do Range in calculated fields
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/28/2003
Status: Unverified

FACT(s) (Environment):

Progress 9.1x

SYMPTOM(s):

Results - cannot do range in calculated fields, it is ignoring the high end value - it only uses the low end value

Doing a range of records based on the MONTH and DAY of the date field.

Do not want to have to fill in 2 range screens (1 for Month and 1 for day).

The substring of the date turns the field from 09/09/2002 to 09/09.

CAUSE:

TESTDATE (variable used in this case)is not set yet when the FOR EACH starts executing.

The bounds (qbf-beg-1 and qbf-end-1) must be non-blank for the condition in the WHERE clause to be satisfied properly.

For example, the current WHERE clause checks that InvoiceDate > qbf-beg-1
and InvoiceDate < qbf-end-1. If qbf-beg-1 and qbf-end-1 are blank, this
condition evaluates to FALSE because "" is less than anything else. Assume
InvoiceDate is 09/15/97. We take the first five characters ("09/15") and
compare it to qbf-beg-1 and qbf-end-1. So the comparison looks like:
where "09/15" > "" and "09/15" < "". This will always be FALSE, so no records
will be selected.

The WHERE clause as written will only work if both bounds are specified
(assuming that the TESTDATE initialization problem is also fixed).

FIX:

This can be fixed easily by editing the report procedure as follow:

/* If values weren't entered for the bounds, set them to low/high values.*/
IF qbf-beg-1 = "" THEN qbf-beg-1 = "00/00".
IF qbf-end-1 = "" THEN qbf-end-1 = "99/99".

and

/* The WHERE clause has been modified by replacing TESTDATE with

SUBSTRING(STRING(sports2000.Invoice.InvoiceDate),1,5).*/