Asked By Rohini Kuchadi
10-Feb-12 05:17 AM

Hi this is the query which i have given in he stord procedure.to get start time, duration,title,movie etc from the database.
SELECT AIRPLAY.start_time AS AIRTIME, DATEDIFF(S,AIRPLAY.start_time, AIRPLAY.end_time) AS DURARATION, Titles.name AS SONG, Artists.name AS ARTISTorMOVIE
FROM Songs INNER JOIN
Titles ON Songs.title_id = Titles.title_id INNER JOIN
Artists ON Songs.artistID = Artists.artistID CROSS JOIN
AIRPLAY INNER JOIN
STATIONS ON AIRPLAY.station_id = STATIONS.station_id INNER JOIN
PRODUCTIVITY ON AIRPLAY.start_time = PRODUCTIVITY.start_time WHERE STATIONS.station_id=@stationid AND
AIRPLAY.segment_type_id=1 AND AIRPLAY.start_time>@startNoEarlierThan and AIRPLAY.end_time<@endNoLaterThan and PRODUCTIVITY.new_title_id=Songs.title_id
order by AIRPLAY.start_time asc
Soppose in the textboxes if give the dates like this 'start date = 2010-09-09' and 'enddate = 2010-09-11'. It should show me the recordes present in between these dates.
But it is not showing me like that.if am giving the dates which i have mentioned above then only it is records that are present. If i give any other dates it is showing me the result as '0'