I've got an issue with a crystal report. For the records that I'm trying to recieve, I assume I need to create a custom formula in the Select Expert. I've tried to write this formula in several ways, but it doesn't pull up the correct information. The formula in the Select Expert should shape the SQL query, but this is not happening.

The formula is:

{Table.Parm1} = {?Parm1} and
date(year({?Parm From Date}), month({?Parm From Date}), 01) <= date({Table.Parm2}, {Table.Parm3}, 01) and
date(year({?Parm To Date}), month({?Parm To Date}), 01) >= date({Table.Parm2}, {Table.Parm3}, 01) and
{Table.Parm4} = {?Parm4} and
{Table.Parm5} = {?Parm5}

and the SQL query it creates is:

Table."Parm1", Table."Parm2", etc..
Database Name."Table" Table
Table."Parm1" = ? AND
Table."Parm4" = 571 AND
Table."Parm5" = ?
Table."Parm3" ASC

The SQL query is not picking up the values of Parm1 and Parm5 which are entered while refreshing the report data.

Anyone who knows what's happening?

Thanks for your help.