Select tblsections.sectionid, tblsections.banner,tblsections.Sub_banner, tblLayouts.layoutfilename from tblsections, tbllayouts where (tblsections.type = 1 and tblsections.sectionid = #url.sectionid#) and tbllayouts.layoutid=tblsections.sectionlayoutid Select distinct '' as surveyid, '' as surveyimage, '' as surveytext, '' as title, '' as brief_Desc, 0 as Article_ID, trelsectionart.articleid, trelsectionart.FS_TEXTONLY, trelsectionart.FS_ORDER, trelsectionart.FS_EXP_DATE, trelsectionart.FS_STATUS From TrelSectionArt, Tblsections Where tblsections.sectionid = #url.sectionid# and trelsectionart.SECTIONID = tblsections.SECTIONID and tblsections.type = 1 and Tblsections.STATUS = 1 and trelsectionart.articleid is null and trelsectionart.FS_TEXTONLY is not null and trelSectionArt.FS_Status = 1 and (trelsectionart.FS_EXP_DATE >= #CreateODBCDate(Now())# or trelsectionart.FS_EXP_DATE is null) union all Select distinct '' as surveyid, '' as surveyimage, '' as surveytext, tblArticles.title as title, tblArticles.brief_Desc as brief_Desc, tblArticles.ArticleID as Article_ID, trelsectionart.articleid, trelsectionart.FS_TEXTONLY, trelsectionart.FS_ORDER, trelsectionart.FS_EXP_DATE, trelsectionart.FS_STATUS From TrelSectionArt, Tblsections, tblArticles Where tblsections.sectionid = #url.sectionid# and trelsectionart.SECTIONID = tblsections.SECTIONID and tblsections.type = 1 and Tblsections.STATUS = 1 and trelSectionArt.FS_Status = 1 and tblArticles.articleid = trelsectionart.articleid and (trelsectionart.FS_EXP_DATE >= #CreateODBCDate(Now())# or trelsectionart.FS_EXP_DATE is null) union all Select distinct TrelSectionSurvey.surveyid as surveyid, TrelSectionSurvey.surveyimage as surveyimage, TrelSectionSurvey.surveytext as surveytext, '' as title, '' as brief_Desc, 0 as Article_ID, trelsectionart.articleid, trelsectionart.FS_TEXTONLY, trelsectionart.FS_ORDER, trelsectionart.FS_EXP_DATE, trelsectionart.FS_STATUS From TrelSectionArt, Tblsections, tblArticles, TrelSectionSurvey Where tblsections.sectionid = #url.sectionid# and trelsectionart.SECTIONID = tblsections.SECTIONID and tblsections.type = 1 and tblsections.STATUS = 1 and trelSectionArt.FS_Status = 1 and trelsectionart.articleid is null and trelsectionart.FS_TEXTONLY is null and TrelSectionSurvey.sectionid = tblsections.sectionid and (trelsectionart.FS_EXP_DATE >= #CreateODBCDate(Now())# or trelsectionart.FS_EXP_DATE is null) order by trelsectionart.FS_ORDER Select tblmediafiles.MFName, trelsectionmedia.Med_Order, tblmediafiles.Image, tblmediafiles.Op_Image, tblmediafiles.Html, tblmediafiles.type, tblmediafiles.MFLink from tblmediaFiles, trelsectionmedia, tblsections where tblsections.sectionid = #url.sectionid# and trelsectionmedia.sectionid=tblsections.sectionid and tblmediafiles.mediaid = trelsectionmedia.mediaid and tblsections.type = 1 and (trelsectionmedia.EXP_DATE >= #CreateODBCDate(Now())# or trelsectionmedia.EXP_DATE is null) order by trelsectionmedia.med_order select distinct tblArticles.articleid, tblarticles.title, tlkpTopicGroup.TopicName, tlkpTopicGroup.TopicID from tblArticles, tlkpTopicGroup, TrelSectionArt where trelSectionArt.sectionid=#url.sectionid# and tblArticles.articleid = trelSectionArt.articleid and tblArticles.Status = 1 and ( (TblArticles.CAL_DATE_Start <= #CreateODBCDate(Now())# and TblArticles.CAL_DATE_END >= #CreateODBCDate(Now())# and TblArticles.CAL_DATE_END is not null and TblArticles.CAL_DATE_Start is not null) or (TblArticles.CAL_DATE_END is null and TblArticles.CAL_DATE_Start is not null and TblArticles.CAL_DATE_Start <= #CreateODBCDate(Now())#) or (TblArticles.CAL_DATE_Start is null and TblArticles.CAL_DATE_END is not null and TblArticles.CAL_DATE_END >= #CreateODBCDate(Now())#) or (TblArticles.CAL_DATE_Start is null and TblArticles.CAL_DATE_END is null) ) and tblArticles.Topicid = tlkpTopicGroup.Topicid order by tlkpTopicGroup.TopicName, tblarticles.title Select b.sectionid,b.parentsectionid, b.sectionname from tblsections as a, tblsections as b where a.sectionid = #url.sectionid# and a.parentsectionid is not null and b.sectionid = a.parentsectionid