How to pass a default value (formula) to a SQL command Parameter?
Posted on 2008-10-21
I have a report that uses a SQL command exclusively. It doesn the querying in the command and there is one parameter which is a date as a string. In testing I was typing in the parameter manually each time I ran the report. Now I am done testing and want to have the report run automatically for the previous day usually would use a TOTEXT(CurrentDate-1, "YYYYMMDD") in the record selection. I don't have the opportunity to do that now that I am using a sql command with a paramter. So how do I pass in this default behavior. I know I could go in and edit the query to generate the date that way without a parameter but that means I need to have one report that defaults to this behavior in the SQL command and another that just uses the prompt for a user to run any given day.
I know the default would still be the same but my goal is to have the user do both while not needing two reports and not needing them to have to change the SQL command at all.