Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2015
    Posts
    11

    functions / queries

    I've got a few lookup queries that return one result (for conversions), I've been trying to use them in a calculated field in another table.

    How would I go about using that result in a calculated field function?

    Any suggestions.



    Thanks,
    Joe

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What do you mean by 'lookup queries'?

    How are you trying to use in calculated field?

    Calculated field in table cannot call custom functions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jun 2015
    Posts
    11
    Right, that's why I've been having problems. I've got a conversion table that has one record with 3 fields in it. I need to lookup each of these fields for a calculation in another table.

    What would you recommend?

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Joe,

    Readers are not familiar with you or your environment. Can you describe to us in plain, simple English what you are trying to do? The simpler the better, and once readers understand your requirement and situation, I'm sure more focused responses will evolve.

    Also, an example showing input and expected outputs is often helpful.

  5. #5
    Join Date
    Jun 2015
    Posts
    11
    Click image for larger version. 

Name:	Untitled2.png 
Views:	11 
Size:	75.4 KB 
ID:	20955
    Click image for larger version. 

Name:	Untitled2.png 
Views:	12 
Size:	108.9 KB 
ID:	20956

    I've got values (3 lookup values) in the global rates table, that I want to use to calculate fields in the UK products table (3 calculated fields) .

    Wondering how I should go about it.

    Thanks,
    Joe

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Build a query of the UK table and do calcs in query.

    Or build a report and do calcs in textboxes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What are the units for ShippingCost? US Dollars? GBP?
    Global rates change frequently, how do you account for the changes?

    You have shown us a row in a table (UKProduct) that includes costs in USD. But what exactly are you trying to do? You don't need to store all currencies for all products. You can work in your local currency and convert when required via the Rates table.

    Often people will have a table of Currency/Exchange Rates.
    They will record their inventory in one common/local currency.
    They will identify shipping charges in some common/local currency.
    When an item is sold, they will work with the common/local currency, join to the Currency/Exchange Rates table in order to get the Rate in the desired currency.

    eg A Book costs 12.5 kilowhatzits
    Code:
    CurrencyExchangeRates (fictitious for illustration only)
    1 kilowhatzit ------>  23.75 US Dollars
                       ------>  18.86 CDN Dollars
                       ------> 200    Faroe Island Kroner
                       ------> 327.8 Zuyang Pesos
    The arithmetic

    If 1 kilowhatzit is equivalent to 23.75 US dollars
    then 12.5 kilowhatzits is equivalent to (12.5 * 23.75) = 296.875 US Dollars

    Since the Rate table can change often, the rates may be replaced/updated daily/weekly.

  8. #8
    Join Date
    Jun 2015
    Posts
    11
    Thanks, so I'll move those calculated fields from the product table and put them in a query and join it as a subform of the product. I'll try that.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Help with functions
    By cc.caroline15 in forum Programming
    Replies: 5
    Last Post: 02-04-2015, 08:26 PM
  2. Replies: 5
    Last Post: 06-22-2012, 09:02 AM
  3. User functions within queries...
    By ChaosInACT in forum Queries
    Replies: 5
    Last Post: 01-19-2012, 06:39 PM
  4. Functions
    By jamin14 in forum Programming
    Replies: 1
    Last Post: 03-25-2010, 08:16 AM
  5. Replies: 0
    Last Post: 06-07-2007, 02:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums