You need to add a function to validate the parameters.
Go to the Report Properties under the Report menu and place this code to the Code Tab.
Public Function CheckDate(SDate as Date, EDate as Date) as IntegerDim msg as Stringmsg = “”If (SDate > EDate) Thenmsg=”Start Date should not be later than End Date”End IfIf msg <> “” ThenMsgBox(msg, 16, “Parameter Validation Error”)Err.Raise(6,Report) ‘Raise an overflowEnd IfEnd Function
Then go to the Report Parameters and Add named it XXX with the datatype as string.
Checked the Hidden and Allow blank value ckeckboxes.
In Available Values choose Non-Queried and from Default Values choose Non-Queried in right side of textbox then press the FX button then paste this code.
=CODE.CheckDate( .Value)
Then press OK.
Find the complete solution at:-http://www.sqlservercentral.com/Forums/Topic537763-145-1.aspx
Recent Comments