Click here to Skip to main content
15,885,953 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
SQL
-- =============================================
-- Author:      <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER Procedure GetNowShowingMovies
AS
select distinct(m.MovieName+' ('+m.Language+')') as MovieWithLanguage,m.*  from Movies m inner join
MovieTimings mt on mt.MovieID = m.MovieID and
 m.Active = 1  and convert(varchar,mt.Date,112) >= convert(varchar,getdate(),112)  where mt.Active = 1
and convert(varchar,getdate(),112)>=convert(varchar,m.ReleaseDate,112)


[edit]Code block fixed - OriginalGriff[/edit]
Posted
Updated 14-Jan-13 21:47pm
v2

1 solution

This seems half query, you have forgotten to put in actual date.

Anyway, this is giving you movie details from first table (Movies) with date greater than given date (which you have missed in the code in your post). This date should be in yymmdd format i.e. convert(varchar,mt.Date,112) > 20130115

Hope that helps. If it does, mark it as answer/upvote.
Milind
 
Share this answer
 
Comments
OriginalGriff 15-Jan-13 3:48am    
The date portion was swallowed by the HTML - fixed now.
MT_ 15-Jan-13 3:50am    
Great, I would never have guesssed and blame OP only !
OriginalGriff 15-Jan-13 3:57am    
:laugh: It happens far too often!

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