A report that chooses between two addresses (1 Viewer)

Matizo

Registered User.
Local time
Today, 15:31
Joined
Oct 12, 2006
Messages
83
Hello,

I am trying to create a report that will be showing details of the appointment.
There are address details that have to be displayed and here is a problem I don’t know how to solve because I have address details in the customers table and in the appointments table.

If the address details in the appointments table are null the report has to show address details from the customer table and NOT show the address details from the appointments table.

If the address details in the appointments table are not null the report has to show address details from the appointments table and NOT show the address details from the customers table.

Should I create a query first? If yes how it should look like?
If no, is there any way of doing this?

Thanks in advance,
Matt
 

Dennisk

AWF VIP
Local time
Today, 23:31
Joined
Jul 22, 2004
Messages
1,649
create a seperate query dealing only with this address issue, and so long as you retain the Primary key you can the re-use the query.

if you link the two table together is a query you can then use an InLine IF statement to determine which address to use.

e.g. Address:IIF(isnull(mytable01.address),mytable02.address,mytable01.address)
 
Last edited:

Matizo

Registered User.
Local time
Today, 15:31
Joined
Oct 12, 2006
Messages
83
Dennisk thanks for reply:)
I used your idea and it works!:)

I have made a query with these details and I've got what I need:

HouseNo: IIF(IsNull(tblAppointments.HouseNo),tblCustomers.HouseNo,tblAppointments.HouseNo)
Street: IIF(IsNull(tblAppointments.Street),tblCustomers.Street,tblAppointments.Street)
PostCode: IIF(IsNull(tblAppointments.PostCode),tblCustomers.PostCode,tblAppointments.PostCode)
City: IIF(isNull(tblAppointments.City),tblCustomers.City,tblAppointments.City)


Regards,
Matt
 

Users who are viewing this thread

Top Bottom