Hi,
This is my first post.
I have only just started using SQL in Delphi and am obviously doing something wrong.
I have created a membership database and wish to create some RAVE reports for it.
I have a TIBQuery with the following SQL statement in it:
--------------------
select * from PERSON, SESSION, TRAINING_HISTORY
WHERE (ACTIVATED = 'Y') and
(SESSION.SESSION_ID = TRAINING_HISTORY.SESSION_ID) and
(PERSON.PERSON_ID = TRAINING_HISTORY.PERSON_ID) and
(SESSION.SESSIONDATE = '9/01/2006')
order by LAST_NAME
-------------------
and the following code in my "CreateReport" procedure
---------------------
If ReportNo = 1 then
begin
RvClass.Open;
RvClass.Execute;
end;
----------------------
This works perfectly, producing a report of attendances for the given day.
I then start to play with parameters as seen below
-------------------
select * from PERSON, SESSION, TRAINING_HISTORY
WHERE (ACTIVATED = 'Y') and
(SESSION.SESSION_ID = TRAINING_HISTORY.SESSION_ID) and
(PERSON.PERSON_ID = TRAINING_HISTORY.PERSON_ID) and
(SESSION.SESSIONDATE = :SDate)
order by LAST_NAME
---------------------
and the following code in my "CreateReport" procedure
---------------------
If ReportNo = 1 then
begin
qrClass.ParamByName('SDate').Value := '9/01/2006';
RvClass.Open;
RvClass.Execute;
end;
----------------------
This produces no errors, but gives a blank report.
In the long run I want to replace '9/01/2006' with a veriable but need to get this working first.
Can anyone help.
Much apreciated
Colin
This is my first post.
I have only just started using SQL in Delphi and am obviously doing something wrong.
I have created a membership database and wish to create some RAVE reports for it.
I have a TIBQuery with the following SQL statement in it:
--------------------
select * from PERSON, SESSION, TRAINING_HISTORY
WHERE (ACTIVATED = 'Y') and
(SESSION.SESSION_ID = TRAINING_HISTORY.SESSION_ID) and
(PERSON.PERSON_ID = TRAINING_HISTORY.PERSON_ID) and
(SESSION.SESSIONDATE = '9/01/2006')
order by LAST_NAME
-------------------
and the following code in my "CreateReport" procedure
---------------------
If ReportNo = 1 then
begin
RvClass.Open;
RvClass.Execute;
end;
----------------------
This works perfectly, producing a report of attendances for the given day.
I then start to play with parameters as seen below
-------------------
select * from PERSON, SESSION, TRAINING_HISTORY
WHERE (ACTIVATED = 'Y') and
(SESSION.SESSION_ID = TRAINING_HISTORY.SESSION_ID) and
(PERSON.PERSON_ID = TRAINING_HISTORY.PERSON_ID) and
(SESSION.SESSIONDATE = :SDate)
order by LAST_NAME
---------------------
and the following code in my "CreateReport" procedure
---------------------
If ReportNo = 1 then
begin
qrClass.ParamByName('SDate').Value := '9/01/2006';
RvClass.Open;
RvClass.Execute;
end;
----------------------
This produces no errors, but gives a blank report.
In the long run I want to replace '9/01/2006' with a veriable but need to get this working first.
Can anyone help.
Much apreciated
Colin