TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
baskaran chellasamy
NA
114
150.5k
problem in making stored procedure
Sep 21 2012 6:13 AM
Hello friends
I am with task to make a time table.In that I want to assign teacher for particular class. In class registration i have registered a classes based on fromyear(2012) and Toyear(2013) as a academic year.my doubt is suppose i want to select classes in the academic year(2012-2013)based on the current year in sql queries then from janaury to march would get next year class details.how to avoid rectify this problem.
My stored procedure for getting class below. its work fine for upto december then from january it gives the next year class detail.
<pre lang="sql">alter procedure sp_addstandered
as
begin
declare @fromyear int,@toyear int
set @fromyear=convert(int,datepart(year,getdate()))
set @toyear=@fromyear+1
select Standered_name from Standered_details where Acadamic_year_id=(select Acadamic_year_id from Acadamic_year where Acadamic_year_from=@fromyear and Acadamic_year_to=@toyear)
end</pre>
Reply
Answers (
0
)
Difference betwwen retesting and regression testing.
Temporary Table in SQL Server