Select tblsections.sectionid, tblLayouts.layoutfilename from tblsections, tbllayouts where
tblsections.type = 3 and tblsections.status=1 and tbllayouts.layoutid=tblsections.sectionlayoutid
Select
'' 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 trelsectionart.SECTIONID = tblsections.SECTIONID
and
tblsections.type = 3
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
'' 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 trelsectionart.SECTIONID = tblsections.SECTIONID
and
tblsections.type = 3
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 trelsectionart.SECTIONID = tblsections.SECTIONID
and
tblsections.type = 3
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
trelsectionmedia.mediaid=tblmediafiles.mediaid
and
trelsectionmedia.sectionid=tblsections.sectionid
and tblsections.type = 3
and (trelsectionmedia.EXP_DATE >= #CreateODBCDate(Now())# or trelsectionmedia.EXP_DATE is null)
order by trelsectionmedia.med_order
">
">
">
'>