Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Address format query

    I have the following queries to format addresses in a report connected to a Postgres database. This is the first time I'm trying to use the syntex formatAddr and don't fully understand how it works. Is this a function in Postgres or the report. I took this from an existing report and when I take out the country (which I don't want as part of the address displayed) then the complete address does not display at all.

    Code:
    formatAddr(invchead_billto_address1, invchead_billto_address2, invchead_billto_address3, ( invchead_billto_city || '  ' || invchead_billto_state || '  ' || invchead_billto_zipcode ), invchead_billto_country) AS f_billtoaddress,

    This is the complete query

    Code:
    SELECT 
    
    --Due Date
    formatDate(determineDueDate(invchead_terms_id, invchead_invcdate)) AS due_date,
    --Discount Date
    formatDate(determineDiscountDate(invchead_terms_id, invchead_invcdate)) AS dis_date,
    
          --remitto.*,
    remitto_name,
    formatAddr(remitto_address1, remitto_address2, remitto_address3, remitto_citystatezip, remitto_country) AS remitto_adr,
          invchead_invcnumber AS invoicenumber,
          formatDate(invchead_invcdate) AS f_invoicedate,
          cust_number,
          invchead_billto_name,
          formatAddr(invchead_billto_address1, invchead_billto_address2, invchead_billto_address3, ( invchead_billto_city || '  ' || invchead_billto_state || '  ' || invchead_billto_zipcode ), invchead_billto_country) AS f_billtoaddress,
          invchead_billto_phone,
          invchead_shipto_name,
          formatAddr(invchead_shipto_address1, invchead_shipto_address2, invchead_shipto_address3, ( invchead_shipto_city || '  ' || invchead_shipto_state || ' ' || invchead_shipto_zipcode ), invchead_shipto_country) AS f_shiptoaddress,
          invchead_ordernumber AS ordernumber,
          invchead_ponumber,
          formatDate(invchead_orderdate) AS f_orderdate,
          formatDate(invchead_shipdate) AS f_shipdate,
          invchead_fob, terms_descrip, invchead_shipvia
    FROM remitto, cust, invchead, terms
    WHERE ( (invchead_cust_id=cust_id)
    AND (invchead_terms_id=terms_id)
    AND (invchead_id=<? value("invchead_id") ?>) )
    ORDER BY ordernumber;

  2. #2
    Join Date
    Nov 2003
    Posts
    2,815
    formatAddr is not a standard PostgreSQL function. It must be something developed by your company.
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  3. #3
    Join Date
    Nov 2012
    Posts
    2
    Ok so it must be a report designer function

    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •