Click here to Skip to main content
15,891,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
ALTER proc [dbo].[sp_chart1](@from as varchar(30),@to as varchar(30))
as 
begin
DECLARE @ft datetime
DECLARE @tt datetime
set @ft=CONVERT(datetime,@from)
set @tt=CONVERT(datetime,@to)
CREATE VIEW VIEW11 AS SELECT Time_Sheet.entry_by,Time_Sheet.duration,Module_Master.module_name FROM Time_Sheet INNER JOIN Module_Master ON Time_Sheet.module_id=Module_Master.module_id where Time_Sheet.create_date>=@ft and Time_Sheet.create_date<=@tt
end


note:-
the above stored procedure gives error plz help me friends ..
Posted
Updated 8-Apr-13 3:27am
v2
Comments
Pablo Aliskevicius 8-Apr-13 9:26am    
Did you read the error message? They usually point you in the right direction.

1 solution

Why change the view? Isn't the date part of the select you would perform on that view?

SELECT ... 
  FROM VIEW11 
  WHERE Time_Sheet.create_date>=@ft 
  AND Time_Sheet.create_date<=@tt


Good luck!
 
Share this answer
 
Comments
Maciej Los 8-Apr-13 10:42am    
Good work, my 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900