Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 14th, 2006, 08:57 PM
Registered User
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Conditional criteria in query

Hi,

I have a query in which I try to calculate field values depending on the currency and foreign exchange rates.
I have a currency field with the amount value and a combo box where I select the currency for that amount which can be (USD, Euro, BRL, or INR). I have got also another 4 fields with each of currency foreign exchange rates.
I am trying to obtain a new calculated field of Price in Euros if the amount I have in the 1st field is not already in Euros.

Example:

Say:

Field 1-------amount


Field 2---------currency (can be in USD or Euro or BRL or INR
                           depending on a refNo)

Field 3-------------xchange rate


Field of Results-------------field1 * field 3 in Euro depending
                             on the currency in field 2.


Can anyone help, plese?

thank you

dfuas




 
Old January 21st, 2006, 03:39 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It really is better to the calculation on a form or report and not is a query.

I would create a User Defined Function (UDF) that calculates the value you need. Then you can call it from your query, form, or report.

Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Expressions in query criteria thedom Access 2 December 13th, 2007 04:33 PM
Conditional criteria in query dfuas Access VBA 1 January 21st, 2006 03:46 AM
Conditional criteria in query dfuas BOOK: Beginning Access VBA 0 January 15th, 2006 03:19 PM
Criteria in Query lryckman Access 1 June 23rd, 2004 11:11 AM
Query Criteria Clive Astley Access 4 March 25th, 2004 03:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.