/* BookByBISAC */SELECT acc.Account_Site, acc.Pen_Name, acc.Bookstore_Image_Available, acc.PB_ISBN, acc.HC_ISBN, e2obt.bookstore_override, acc.date_uploaded, e2obt.retail_price, e2obt.binding
FROM accounts acc
INNER JOIN e2_ordered_book_types e2obt ON acc.projectid = e2obt.e2_book_project_id
/*INNER JOIN e2_ordered_book_types e2obt ON acc.PB_ISBN = e2obt.isbn*/
WHERE
/*acc.PB_Retail_Price > 0*/
e2obt.Retail_Price > 0
AND (
(
acc.Payment_Problem_Status NOT LIKE '%TERMINATED%'
AND acc.Payment_Problem_Status NOT LIKE '%CANCELLED%'
AND acc.Payment_Problem_Status NOT LIKE '%TOM PROJECT%'
AND acc.Payment_Problem_Status NOT LIKE '%ON HOLD%'
AND acc.Payment_Problem_Status NOT LIKE '%TEST PROJECT%'
/*AND acc.Payment_Problem_Status NOT LIKE '%EDITORIAL%'*/
AND acc.Payment_Problem_Status NOT LIKE '%ANTHOLOGY PROJECT%'
)
OR (
acc.Payment_Problem_Status IS NULL
)
)
AND DATE(e2obt.date_uploaded) <= DATE_SUB(CURDATE(), INTERVAL 3 DAY)
AND (
(
acc.Program_Order_Date >= '2008-01-01'
AND (
acc.Program_Upgrade LIKE '%Best%'
OR acc.Program_Upgrade LIKE '%Elite%'
OR acc.Program_Upgrade LIKE '%Debut%'
OR acc.Program_Upgrade LIKE '%Tribute%'
OR acc.Program_Upgrade LIKE '%Showcase%'
OR acc.Program_Upgrade LIKE '%Premier%'
OR acc.Bookstore_Page_Order_Recd IS NOT NULL
)
)
OR (
acc.Program_Order_Date >= '2008-01-01'
AND (
acc.Program LIKE '%Premium%'
OR acc.Program LIKE '%Best%'
OR acc.Program LIKE '%Elite%'
OR acc.Program LIKE '%Tribute%'
OR acc.Program LIKE '%Debut%'
OR acc.Program LIKE '%Showcase%'
OR acc.Program LIKE '%Premier%'
OR acc.Program LIKE '%Editor%Choice%'
)
)
OR (
acc.Program_Order_Date <= '2007-12-31'
)
)
AND acc.Bookstore_Active = 1
AND e2obt.binding != 'EB'
AND e2obt.binding != 'AB'
AND (acc.expanded_distribution != 'Yes' or acc.expanded_distribution is null)
AND acc.imprint_brand_id = 1
/*AND ( acc.Imprint LIKE 'Xulon Press' OR acc.Imprint = '' OR acc.Imprint IS NULL )*/
AND ( acc.Imprint NOT LIKE 'Crown Oak%' AND acc.Imprint NOT LIKE 'Townhall%' AND acc.Imprint NOT LIKE 'Evangelical Press%' OR acc.Imprint = '' OR acc.Imprint IS NULL)
/*AND acc.short_run IS NULL*/
AND (
acc.BISAC_Code_1 = 'REL012050'
OR acc.BISAC_Code_2 = 'REL012050'
OR acc.BISAC_Code_3 = 'REL012050'
/*
LEFT(acc.BISAC_Code_1,3) LIKE 'REL%'
OR LEFT(acc.BISAC_Code_2,3) LIKE 'REL%'
OR LEFT(acc.BISAC_Code_3,3) LIKE 'REL%'
acc.BISAC_Code_1 = "REL012050"
OR acc.BISAC_Code_2 = "REL012050"
OR acc.BISAC_Code_3 = "REL012050"
*/
) AND ( e2obt.retail_price BETWEEN 0.99 AND 38.99) GROUP BY acc.projectid ORDER BY date_uploaded DESC LIMIT 1,Error - Exception in query
Christian Author Bookstore - Xulon Press Publishing