crosstab report access violation with 8th field

hsmhsm
edited 1:33PM in FastReport 4.0
Using Delphi 2009 connected to an access 2003 database.

I'm have a cross tab report generated from a query that includes sub queries for some of its fields (see below).
The query works OK and the results can be seen in a 'live' grid control at design time.
The cross tab report also works fine with several columns added from the query.

However it always fails if I try to add as a column one of the fields that is generated from a sub query.
Then I get 'Access violation at address 0A112C1B in module frxDB12.bpl. Read of address 00000000'

A snippet from the SQL the query uses is below . The reort pivots on WeekNumber, the cell value is the CumulativePresentPercent, all other fields are additional tems on each row. It fails if I try to add AutumHT or XmasHT to the report.

SELECT
tbl_attendance.AdNo ,
tbl_attendance.Legal_Surname ,
tbl_attendance.Gender ,

(SELECT cumulativePresentPercent
FROM tbl_attendance AS T
WHERE t.weeknumber=8
AND t.Adno = tbl_attendance.adno
) AS AutumHT ,

(SELECT cumulativePresentPercent
FROM tbl_attendance AS T
WHERE t.weeknumber=15
AND t.Adno = tbl_attendance.adno
) AS XmasHT ,

tbl_attendance.WeekNumber ,
tbl_attendance.CumulativePresentPercent

FROM
tbl_attendance

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.