If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > PostgreSQL > Address format query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
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;
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Nov 2003
Posts: 2,799
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
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Nov 2012
Posts: 2
Ok so it must be a report designer function

thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On