Post Author: peachpx
CA Forum: General
Hi,
Can anyone tell me how to add Set to Null check box option in the parameter prompt?
My report is asking to choose Begin Date and End Date u2013 with date calendar pick. Next to the prompt field I have to have Set to Null check box. How do I solve this? Report is using a SQL query to get the data in ether one of these this formats:
At the begining of the query:
declare @begin_date datetime;
declare @end_date datetime;
declare @plant_id numeric;
SET @BEGIN_DATE = CAST(CONVERT(VARCHAR,ISNULL({?Begin Date},GETDATE() - 7.0),1) + ' 06:30 AM' AS DATETIME)
SET @END_DATE = CAST(CONVERT(VARCHAR,ISNULL({?End Date},GETDATE()),1) + ' 06:30 AM' AS DATETIME)
SET @plant_id = ISNULL({?Plant},1)
OR in the end:
WHERE PR.Plant_id = isnull({?Plant},1) and
re.INSP_DATETIME >= cast(convert(varchar,isnull({?Begin Date},getdate() - 7.0),1) + ' 06:30 AM' as datetime) and
re.INSP_DATETIME < cast(convert(varchar,isnull({?End Date},getdate()),1) + ' 06:30 AM' as datetime)
Some older reports do have Set to Null option, but I don't know how to add it to mine. Set to null ether defaults it to the current date or two weeks ago.
Please help!