SELECT content_title , -- Get Start Date And Time - Start LEFT(REPLACE(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''), substring(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''), patindex('%</StartTime>%', REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), '')), DATALENGTH(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''))), ''), 10) AS StartDate ,RIGHT(REPLACE(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''), substring(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''), patindex('%</StartTime>%', REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), '')), DATALENGTH(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''))), ''), 8) AS StartTime , -- Get Start Date And Time - Stop -- Get End Date And Time - Start LEFT(REPLACE(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), ''), substring(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), ''), patindex('%</EndTime>%', REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), '')), DATALENGTH(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), ''))), ''), 10) AS EndDate ,RIGHT(REPLACE(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), ''), substring(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), ''), patindex('%</EndTime>%', REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), '')), DATALENGTH(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 156), ''))), ''), 8) AS EndTime -- Get End Date And Time - Stop FROM content WHERE folder_id = 258731 AND CAST(LEFT(REPLACE(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''), substring(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''), patindex('%</StartTime>%', REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), '')), DATALENGTH(REPLACE(CAST(content_html AS VARCHAR(250)), LEFT(CAST(content_html AS VARCHAR(250)), 116), ''))), ''), 10) AS DATETIME) >= '2012-09-07' ORDER BY StartDate ,StartTime
Last Updated on October 26, 2015