Ive noticed that there is an issue with Categories and the associated SubCategories for a listing being saved in different tables. The problem with this is the SQL function in the Advanced Search has a bunch of UNIONed queries referencing the "same" tables.
How is the data stored in the different tables? Rather than create a further 16 Union queries - how can I guarantee that a category or subCategory will be saved in a specific table, say [KB_XMod_Index_VC50] or [KB_XMod_Index_VC100]
The only way I can retun any data is chaning the SQL to something like.
Select DISTINCT t1.[Value] FROM {DBobjQual}[KB_XMod_Index_VC50] t1 JOIN (SELECT FormId, XmodID, Approved FROM {DBobjQual}[KB_XMod_Modules]) t2
ON t1.XmodID = t2.XmodID AND t1.[key] = 'SavedSubCategory' AND (t2.[FormId] = {BDFormId})
JOIN {DBobjQual}[KB_XMod_Index_VC100] t3 ON t1.XmodID = t3.XmodID AND (t3.[key] = 'cboCategory') AND (t3.[value] = '{selCategory}')
It would be good to get all the data for a listing into the same table.
Thanks
|