[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error: searching for customer by address field

On 6/10/07, Stroller <..hidden..> wrote:
Under AR > Customers > Reports > Search, I get the following error if
I try to search by street name.

I assume this is a known issue & not unique to my installation, but I
send it just in case it's otherwise.


DBD::Pg::st execute failed: ERROR: column "street" does not exist

SELECT ct.*, b.description AS business,
e.name AS employee, g.pricegroup,
l.description AS language, m.name AS manager
FROM customer ct
LEFT JOIN business b ON (ct.business_id = b.id)
LEFT JOIN employee e ON (ct.employee_id = e.id)
LEFT JOIN employee m ON (m.id = e.managerid)
LEFT JOIN pricegroup g ON (ct.pricegroup_id = g.id)
LEFT JOIN language l ON (l.code = ct.language_code)
WHERE 1 = 1 AND (lower(ct.address1) LIKE '%street%' OR lower
(ct.address2) LIKE ''%street%'') ORDER BY name ASC
ERROR: column "street" does not exist

OK, two things:
1.  why don't you use ILIKE instead of LIKE and you can forget about
case (and that OR clause that's giving you the error).
2.  your problem is in the second "%street%".  Change the double
quotes to single quotes and the error will go away.


David A. Bandel
Focus on the dream, not the competition.
           - Nemesis Air Racing Team motto