[Koha-patches] [PATCH] [followup](MT3160) fix address request
Michael Hafen
mdhafen at tech.washk12.org
Wed Jun 30 17:03:51 CEST 2010
I have found in Mysql that CONCAT_WS handles NULL values well. Have you
looked into that? The syntax is a little different from CONCAT.
On Wed, 2010-06-30 at 13:59 +0200, Nahuel ANGELINETTI wrote:
> If any part of concat is null, all the address field is null.
> Now we use IFNULL() from mysql.
> ---
> C4/Overdues.pm | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/C4/Overdues.pm b/C4/Overdues.pm
> index d9bd420..2a226ac 100644
> --- a/C4/Overdues.pm
> +++ b/C4/Overdues.pm
> @@ -199,7 +199,11 @@ sub GetOverduesByBorrowers{
> surname,
> firstname,
> title,
> - CONCAT(borrowers.streetnumber, ' ', borrowers.address, '\n', borrowers.address2) as address,
> + CONCAT(
> + IFNULL(borrowers.streetnumber,''), ' ',
> + IFNULL(borrowers.streettype,'') , ' ' ,
> + IFNULL(borrowers.address,''), '\n', IFNULL(borrowers.address2,'')
> + ) as address,
> city,
> zipcode,
> email,
--
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA
for Koha checkout
http://development.washk12.org/gitweb/
or
git://development.washk12.org/koha
More information about the Koha-patches
mailing list