classLayout: sql: pages.title_en AS ptitle, pci.url AS purl, pci.rank, 'pages' AS tbl
FROM pages INNER JOIN
(
SELECT contentindex.rowid, contentindex.url, (LEN([content])-LEN(REPLACE([content],'','')))/LEN('') AS [rank]
FROM contentindex
WHERE contentindex.[object]='pages' AND contentindex.content LIKE '%%' AND contentindex.lang='en'
GROUP BY contentindex.rowid, contentindex.url, (LEN([content])-LEN(REPLACE([content],'','')))/LEN('')
) pci
ON pages.id=pci.rowid
UNION
SELECT products.name_en AS ptitle, prci.url AS purl, prci.rank, 'products' AS tbl
FROM products INNER JOIN
(
SELECT contentindex.rowid, contentindex.url, (LEN([content])-LEN(REPLACE([content],'','')))/LEN('') AS [rank]
FROM contentindex
WHERE contentindex.[object]='products' AND contentindex.content LIKE '%%' AND contentindex.lang='en'
GROUP BY contentindex.rowid, contentindex.url, (LEN([content])-LEN(REPLACE([content],'','')))/LEN('')
) prci
ON products.id=prci.rowid
UNION
SELECT news.title_en AS ptitle, nci.url AS purl, nci.rank, 'news' AS tbl
FROM news INNER JOIN
(
SELECT contentindex.rowid, contentindex.url, (LEN([content])-LEN(REPLACE([content],'','')))/LEN('') AS [rank]
FROM contentindex
WHERE contentindex.[object]='news' AND contentindex.content LIKE '%%' AND contentindex.lang='en'
GROUP BY contentindex.rowid, contentindex.url, (LEN([content])-LEN(REPLACE([content],'','')))/LEN('')
) nci
ON news.id=nci.rowid
ORDER BY rank DESC
[Microsoft][ODBC Microsoft Access Driver]Numeric value out of range