I have a list of people and addresses.
there are field for home (physical) address and fields for a mailing address.
some people have separate mailing addresses, with PO Box, etc.
I want to create a "mailing list" that will show the home address for each person and the mailing address for those who have a mailing address ... in pseudocode:
if mailing address is empty,
show home address
else show mailing address
fields look like this:
lastName
stNum
Street
City
State
Zip
MalingAddress
MailingCity
MailingState
MailingZip
The SQL statement in Access (which works) looks like this:
SELECT DISTINCT voters.LastName,
IIf(IsNull([MailingAddress]),[houseNum] & " " & [Street] & " " & [AptNo],[MailingAddress]) AS LabelStNum,
IIf(IsNull([MailingAddress]),[City],[MailingCity]) AS labelCity,
IIf(IsNull([MailingAddress]),[State],[MailingState]) AS labelState,
IIf(IsNull([MailingAddress]),[Zip],[MailingZip]) AS labelZip
FROM voters
WHERE (((voters.Party) Not Like "R") AND ((voters.Moved)<>Yes) AND ((voters.Deceased)<>Yes));
To clarify: The if statements for the City (as an example) is as follows:
IIf(isNull[MailingAddress], // if the mailing address is empty
[City], // use the standard city field
[MailingCity], // else use the mailing address city field
As labelCity // put result into a new field called labelCity
The above access statement doesn't translate directly into SQL (I can't just copy and paste it into php runner) and I can't find a way to translate this ... is there a way to do this in phprunner? (i'm currently using php 3.1)
thanks much,
karen