Hi,
I have the following SP
I am calling it with the following...
Which should trigger the default values (shouldn't it?)
But I seem to be getting zero records returned instead of all of them?
If I use
I get the expected returned records.
So what's wrong with the empty strings for the date parameters and why isn't it triggering the default values?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I have the following SP
Code:
PROCEDURE [dbo].[spADM_RiskData]
@MemNo varchar(12) = '%',
@StartDate char(10) = NULL,
@EndDate char(10) = NULL
AS
BEGIN
SET NOCOUNT ON;
-- Set default dates
Set @StartDate = coalesce(@StartDate, '2008-01-01')
Set @EndDate = coalesce(@EndDate, Convert(char(10), GetDate(), 121))
SELECT Case_ID,Adv_MemNo,Reason
FROM Case_Checking INNER JOIN Business_Register
ON Case_Checking.Case_ID = Business_Register.Rec_ID
WHERE (Flag_Date BETWEEN @StartDate AND @EndDate) AND Adv_MemNo LIKE @MemNo + '%'
END
I am calling it with the following...
Code:
spADM_RiskData '','',''
Which should trigger the default values (shouldn't it?)
But I seem to be getting zero records returned instead of all of them?
If I use
Code:
spADM_RiskData '','2008-01-01','2013-03-06'
I get the expected returned records.
So what's wrong with the empty strings for the date parameters and why isn't it triggering the default values?
Thanks,
1DMF
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads