【发布时间】:2013-10-02 21:08:04
【问题描述】:
SELECT CTT.BAN, `Company`, `CID`, `FName`, `MInit`,
`LName`, `OName`, `Address`, `City`, `State`,
`PostalCode`, `ActiveDate`, `ClosedDate`, `Draft`,
`Credit`, `BillingCycle`, `BillingFreq`, `Suspended`,
`Paperless` , BTT.Bal
FROM CustomerT CTT
JOIN BalanceT BTT
ON (CTT.BAN = BTT.BAN)
WHERE `Paperless` != '1'
AND `BankDraft` != -1
AND `CreditCard` != -1
AND (`BillingCycle` = '1' OR `BillingCycle` = '0')
AND `Bal` > 2
AND (`AccountClosedDate` IS NULL OR
DATE(`AccountClosedDate`) >= (NOW() - INTERVAL 180 DAY) )
一切都适用于这个查询,但 180 日期 peice 我已经从这个站点尝试了几件事,但没有运气。我只需要将最近 6 个月的关闭帐户包含在表格中。
【问题讨论】:
-
不应该是 >= (NOW() - INTERVAL 180 DAY) - 我的意思是 AccountClosedDate 大于,不少于,180 天前?