Mr_Shaw
asked on
how to declare variables in a view
I have a sql query in a view which I would like to use variables.
(@start_date datetime, @end_date datetime)
when I run the query i get an error saying;
must declare scalar variable @start_date.
I am not sure what this means?
(@start_date datetime, @end_date datetime)
when I run the query i get an error saying;
must declare scalar variable @start_date.
I am not sure what this means?
ASKER
can I have three stored procedures and link them together with a cross join?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, will give it a go.
You can create a user defined function OR a stored procedure and pass the variables to that and have either the UDF or SP return a record set.
I just did this using a stored procedure and it worked great for me.