Results 1 to 4 of 4
  1. #1
    ChristopherL is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2013
    Posts
    18

    Update query

    Hiho, first of all I'd like to thank those giving me assistance here, great support, knowledge and a superior webiste

    Now for my problem


    I want to update a column [Value_Diff_SEK] to a value gained from [Value_Diff]*[rate]. (it takes the value and multiplies it with the swedish SEK rate).

    However, for those values that already have the swedish SEK as currency, it skips and those not add to the column.

    So what I want to do is update those with the wrong currency to the proper currency and just copy the others over to the column in an update query!

    Anyone got a solution for iff statement or anything?

  2. #2
    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,848

  3. #3
    ChristopherL is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2013
    Posts
    18
    Quote Originally Posted by orange View Post
    Please show us the SQL of your query.

    UPDATE FX_RATES INNER JOIN USE_Secondary_Trades ON FX_RATES.CCY1 = USE_Secondary_Trades.CURRENCY SET USE_Secondary_Trades.Value_Diff_SEK = [RATE]*[Value_Diff];

  4. #4
    ChristopherL is offline Novice
    Windows XP Access 2002
    Join Date
    Jul 2013
    Posts
    18
    Tried this now and it did put out the diff's for different rate but it didnt give out the diff's that were alrdy SEK...

    UPDATE FX_RATES INNER JOIN USE_Secondary_Trades ON FX_RATES.CCY1 = USE_Secondary_Trades.CURRENCY SET USE_Secondary_Trades.Value_Diff_SEK = IIf([CURRENCY]="SEK",[Value_Diff]=[Value_Diff_SEK],[RATE]*[Value_Diff]);


    Did it with ii statement in update to row:
    IIf([CURRENCY]="SEK";[Value_Diff]=[Value_Diff_SEK];[RATE]*[Value_Diff])

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

Similar Threads

  1. Replies: 1
    Last Post: 05-17-2013, 12:53 PM
  2. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  3. Replies: 4
    Last Post: 11-10-2011, 03:41 PM
  4. Replies: 2
    Last Post: 09-21-2011, 01:30 PM
  5. Replies: 1
    Last Post: 08-19-2011, 12:16 PM

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