So I have this huge query, but
WHERE dbo.TabModules.ModuleTitle=
ARRAY ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] doesn't work --- and the query is too huge to put into the reports module -- it gets cut off even if uploading. However, pieces of it work so I assume the whole thing would work if it fit.
Other pending issue is displaying the FnL data on the same report (using 2 different datasources in 1 report).
SELECT dbo.HtmlText.Content, dbo.HtmlText.ModuleID, dbo.HtmlText.LastModifiedOnDate
FROM dbo.HtmlText
INNER JOIN dbo.TabModules ON dbo.TabModules.ModuleID = dbo.HtmlText.ModuleID
WHERE (dbo.TabModules.ModuleTitle='June'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='July'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='August'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='September'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='October'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='November'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='December'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='January'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='February'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='March'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='April'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='May'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))
OR
(dbo.TabModules.ModuleTitle='June'
AND dbo.HtmlText.LastModifiedOnDate = (
SELECT MAX(last_mod_alias.LastModifiedOnDate)
FROM dbo.HtmlText AS last_mod_alias
WHERE last_mod_alias.ModuleID = dbo.HtmlText.ModuleID))