Re: disabling wildcard in AR reports

"Paul Tammes" <[email protected]> Thu, 25 May 2006 07:41:52 +0200
Newsgroups gmane.comp.web.sql-ledger.user
Message-ID <001901c67fbd$ecc04d50$940aa8c0@financehq>
In Stead of LIKE using IS would go a long way I would think.
Or EQUALS, my sql is sloppy at best.

You would not find anyone with a typo in the name though..

-----Oorspronkelijk bericht-----
Van: sql-ledger-users-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:sql-ledger-users-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] Namens Donald
Baud
Verzonden: Wednesday, May 24, 2006 4:11 PM
Aan: sql-ledger-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Onderwerp: Re: [SL] disabling wildcard in AR reports


I finally decided to patch AA.pm to suit my needs. 
This is probably very clumsy because I can no longer
search customers with "%customer%" but at least, I can
still do "%customer" or "customer%".

I wish Dieter would add a knob to disable wild card
searching on the form.

--- AA.pm.bak   Wed May 24 09:16:16 2006
+++ AA.pm       Wed May 24 09:54:36 2006
@@ -599,6 +599,7 @@
   } else {
     if ($form->{$form->{vc}}) {
       $var = $form->like(lc $form->{$form->{vc}});
+      $var =~ s/^%(.*)%$/$1/;
       $where .= " AND lower(vc.name) LIKE '$var'";
     }
   }



--- Donald Baud <donaldbaud-/[email protected]> wrote:

> Is there a way to disable wildcard searching on
> customer name?
> I have a few customers setup as: "customer1"
> "customer2" ... "customer100"
> I am trying to show the aging report for "customer1"
> but I keep getting info for "customer10"
> "customer11"
> customer12" ...
> 
> the query being sent to postgres is something like:
> select *
> from customer 
> where lower(vc.name) LIKE '%customer1%'
> 
> Why is the wildcard being added automatically?
> according to the manual, one has to request it with
> the '%' or '_' sign?
> 
> notice: I cannot change the customer name format
> because it is being used as a keyname in other
> applications
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com 
> 
> 
> _______________________________________________
> sql-ledger-users mailing list sql-ledger-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>
https://lists.sourceforge.net/lists/listinfo/sql-ledger-users
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


_______________________________________________
sql-ledger-users mailing list sql-ledger-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/sql-ledger-users



-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.392 / Virus Database: 268.7.0/345 - Release Date: 5/22/2006



_______________________________________________
sql-ledger-users mailing list
sql-ledger-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/sql-ledger-users