Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server-2008
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 8-Apr-13 4:17am
Edited 8-Apr-13 4:27am
Maciej Los150.9K
v2
Comments
Pablo Aliskevicius at 8-Apr-13 9:26am
   
Did you read the error message? They usually point you in the right direction.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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!
  Permalink  
Comments
Maciej Los at 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)



Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100