Topic: sql report help

When I use the following sql statement after 'Save and Close' the report works well, but does not work (ie the report is blank) if the form is only 'Save and do not close'.  What is wrong with this sql statement?

SELECT
tblStudent.fldStudentName,
tblLesson.fldReference,
tblLesson.fldStudentNotes,
tblCompany.fldLogo,
tblLesson.id,
strftime('%d/%m/%Y', fldDateTime),
CASE
        WHEN CAST(strftime('%H', fldDateTime) AS INTEGER) = 12
                THEN strftime('%H:%M', fldDateTime) || ' PM'
        WHEN CAST(strftime('%H', fldDateTime) AS INTEGER) > 12
                THEN strftime('%H:%M', fldDateTime, '-12 Hours') || ' PM'
        ELSE strftime('%H:%M', fldDateTime) || ' AM'
END

FROM tblLesson
LEFT OUTER JOIN tblStudent ON  tblLesson.id_tblStudent=tblStudent.id
LEFT OUTER JOIN tblCompany ON  tblLesson.id_tblCompany=tblCompany.id

WHERE tblLesson.id=$id

Re: sql report help

Please send me project to support@drive-software.com
with link to this topic.

Dmitry.