Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

Searching between dates

edited September 2006 in RAP
?
Hi

can anyone help me with this code I am have created a variable in RAP
(value) which is a simple count based on the query below - I cant get
the Date part of the query ( a search between the dates specified) to
work the code compiles but will not execute and comes back with an
error .....

"cannot generate report"
"Could not run program Variable1oncalc"

I have tried a couple of different coding methods..


IF (Episode['Outcome'] = '61') and

(Episode['End Date'] >= 01/01/2005) and

(Episode['End Date'] <= 31/01/2005)

THEN

Value := Value + 1;

end;



and nesting it....

begin

IF (Episode['Outcome'] = '61') THEN

IF

(Episode['End Date'] >= 01/01/2005) and

(Episode['End Date'] <= 31/01/2005)

THEN

Value := Value + 1;

end;


Any help with this appreciated

many thanks



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited September 2006
    Hello,

    The TDateTime values are essentially doubles so you will need to encode them
    as such when using a date format. For instance...

    IF (Episode['Outcome'] = '61') and

    (Episode['End Date'] >= EncodeDate(2005,1,1)) and

    (Episode['End Date'] <= EncodeDate(2005,1,31))

    THEN

    Value := Value + 1;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.