database - Combine data from multiple Access tables to produce address label, preferring PO box to Physical Address -



database - Combine data from multiple Access tables to produce address label, preferring PO box to Physical Address -

i have access 2007 database has 3 tables, each same.

each of these tables different telemarketer come in leads. necessary there multiple tables each marketer must treated separate entity.

each of these tables has next fields relevant question:

poboxnumber poboxsuburb poboxcity poboxpostcode

addressbuilding addressstreet addresssuburb addresscity addresspostcode

now need create query label printing prefer po box physical address, if po box empty utilize physical.

i need displayed as

addrline1 addrline2 addrline3 addrline4 addrline5

ie addrline1 if pobox filled po box number, otherwise building... , on.

i have tried unions , conditional selects far no avail!

how do this?

perhaps:

select t.poboxnumber addrline1, t.poboxsuburb addrline2, t.poboxcity addrline3, t.poboxpostcode addrline4, "" addrline5 thetable t t.poboxnumber not null union select addressbuilding addrline1, addressstreet addrline2, addresssuburb addrline3, addresscity addrline4, addresspostcode addrline5 thetable t t.poboxnumber null

if not want, please explain why not , provide sample data. question little vague stands.

database database-design ms-access ms-access-2007

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -