I have a query using the same parameter for two columns and another for two contraints:
Code: Select all
SELECT `Benefit`, `NAMES`, `ID`, `Born`, `Sex`, `Bank`, `Suff`, `Place`,
IF( `DirDate` > `EffDate`, DATEDIFF( :Enter_Report_Date, `DirDate` ) * `Rate`,
DATEDIFF( :Enter_Report_Date, `EffDate` ) * `Rate` ) AS `Amount`,
CONCAT_WS( ' - ', IF( `DirDate` > `EffDate`, `DirDate`, `EffDate` ), :Enter_Report_Date ) AS `SWNote`
FROM `test`.`addvouchparam` AS `AddVouchParam`
WHERE `DirDate` >= :Enter_Begin_Date AND `EffDate` >= :Enter_Begin_Date
ORDER BY `Benefit` ASC, `Place` ASC, `Amount` ASC
However, when I change this query into a report, this window pops up again after I just entered the dates in the first window. So, I'm assuming it's asking for the dates for every instance of each parameter in the report. I can't think of a better way formulate this... any ideas?