chrismcaniff
Programmer
Hi,
Trying to create stored procedure with a date parameter.
call sp_aginginvoice ('2008-10-15');
appears to run correctly but when I query the view created I get an expression error.
I have narrrowed error down to datediff :input clause
If I substitute :input for ('2008-10-15') in the code then the procedure works perfect but this defeats purpose of date parameter.
Here is my code:
Create Procedure SP_AgingInvoice stDate char (10));
BEGIN
Declare :Input date;
Set :Input = Cast stDate as date);
Create View AgingInvoice as
select invoice.invunique, invoice.nvno, invoice.nvdate,
DateDiff(day, invoice.nvdate, :input) as Aging
from Invoice, Account
where account.aunique = invoice.acct;
END;
Any help would be most appreciated!
Thanks
Chris
Trying to create stored procedure with a date parameter.
call sp_aginginvoice ('2008-10-15');
appears to run correctly but when I query the view created I get an expression error.
I have narrrowed error down to datediff :input clause
If I substitute :input for ('2008-10-15') in the code then the procedure works perfect but this defeats purpose of date parameter.
Here is my code:
Create Procedure SP_AgingInvoice stDate char (10));
BEGIN
Declare :Input date;
Set :Input = Cast stDate as date);
Create View AgingInvoice as
select invoice.invunique, invoice.nvno, invoice.nvdate,
DateDiff(day, invoice.nvdate, :input) as Aging
from Invoice, Account
where account.aunique = invoice.acct;
END;
Any help would be most appreciated!
Thanks
Chris