AbrahamA
4Penny.net
Points: 7625

2/10/2014 10:20:20 AM

ddf_Address

* This article, and all our great SQL (General) documentation, Is available on the SQL (General) menu

This is our generic address function that we call into each report that needs an address block.

The goal here is RAD - Rapid Application Development. If we write a function once we blog it here... so it doesn't have to be written again.

Use it like this:

select
        h.sopnumbe,
        dbo.ddf_Address(h.CUSTNAME, SHIPTO.CNTCPRSN, SHIPTO.ADDRESS1, SHIPTO.ADDRESS2, SHIPTO.ADDRESS3, SHIPTO.CITY, SHIPTO.STATE, SHIPTO.ZIP) as address
    from sop10100 h
        join rm00102 SHIPTO on SHIPTO.custnmbr = h.custnmbr and SHIPTO.ADRSCODE = h.PRSTADCD

 

4Penny.net
Version: Unknown or N/A
Section: SQL Scripts
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3