By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Forums - General - Can anyone who has experience in Microsoft Access help me?

I really need help with an IF function. It's driving me nuts. The question is:

Perform a query to deduct a ten percent discount on total payments made by persons who made bookings on the Asian tour. Name this query FurtherDiscount.  

So I made a query with the columns: Name, Total Payment, Tour Specified

It has 4 tours: Asian, European, African, Caribbean

What I want to do is make an if function in my query that says: If Tour Specified=Asian then multiply the Total Payment field by 90%

Damn, can someone help me? Your help would be greatly appreciated!



3DS Friend Code: 0533 - 6146 - 0418
PSN ID: atylerman5

Around the Network

I have no experience in Microsoft Access.



iif ([Tour specified]="asian", [total payment]*.9, [total payment]*1)



 

Face the future.. Gamecenter ID: nikkom_nl (oh no he didn't!!) 

NiKKoM said:

iif ([Tour specified]="asian", [total payment]*.9, [total payment]*1)

Thanks, now it's making some progress, but I have a big problem. Strangely all fields associated with Asian have not been included. Damn you Microsoft! 



3DS Friend Code: 0533 - 6146 - 0418
PSN ID: atylerman5

GdaTyler said:
NiKKoM said:

iif ([Tour specified]="asian", [total payment]*.9, [total payment]*1)

Thanks, now it's making some progress, but I have a big problem. Strangely all fields associated with Asian have not been included. Damn you Microsoft! 


could you make a screenshot of the code you have right now? use tinypic or something similiar to upload a pic and post it here



 

Face the future.. Gamecenter ID: nikkom_nl (oh no he didn't!!) 

Around the Network

I have a download link for the database itself at 4shared. Please tell me when you receive it. The query I'm having trouble with is FurtherDiscount

 

http://www.4shared.com/file/g6hHuTauba/Database1.html



3DS Friend Code: 0533 - 6146 - 0418
PSN ID: atylerman5

Sorry for double post.



3DS Friend Code: 0533 - 6146 - 0418
PSN ID: atylerman5

NiKKoM said:
GdaTyler said:
NiKKoM said:

iif ([Tour specified]="asian", [total payment]*.9, [total payment]*1)

Thanks, now it's making some progress, but I have a big problem. Strangely all fields associated with Asian have not been included. Damn you Microsoft! 


could you make a screenshot of the code you have right now? use tinypic or something similiar to upload a pic and post it here

Actually, I've found out what's wrong. If I multiply the field by anything other than 1 it doesn't show. Any solutions?



3DS Friend Code: 0533 - 6146 - 0418
PSN ID: atylerman5

GdaTyler said:

Actually, I've found out what's wrong. If I multiply the field by anything other than 1 it doesn't show. Any solutions?

I'm actually at home where i don't have a PC.. (Mac only) so I'm winging this from memory..

did you place the iif statement in the Criteria row on the query design view? Delete that. Instead, you need to make the Iif statement its own field in query.



 

Face the future.. Gamecenter ID: nikkom_nl (oh no he didn't!!) 

NiKKoM said:
GdaTyler said:

Actually, I've found out what's wrong. If I multiply the field by anything other than 1 it doesn't show. Any solutions?

I'm actually at home where i don't have a PC.. (Mac only) so I'm winging this from memory..

did you place the iif statement in the Criteria row on the query design view? Delete that. Instead, you need to make the Iif statement its own field in query.

It then tells me enter parameter value. >:(



3DS Friend Code: 0533 - 6146 - 0418
PSN ID: atylerman5