Results 1 to 3 of 3
  1. #1
    Guy Winfield is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    May 2015
    Posts
    7

    Converting Excel Formula to Access Query Format

    Hello everyone,

    I've been having problems with a formula that i have in Excel that i wish to convert into access in order to play around with my database.
    Can somebody please tell me where i'm going wrong ?


    OTD Réel: VraiFaux(Ou([011- Extraction FA ENSEMBLE]![OTD Prév]=1;Et([livraisons]![Dt BL]<=[livraisons]![Dt Prom];[livraisons]![Qté facturée]=[livraisons]![Qté cde];"1")))VraiFaux([livraisons]![Dt BL]<=[livraisons]![Dt Prom]; [livraisons]![Qté facturée]/[livraisons]![Qté cde];"0")

    =SI(OU(D3=1;ET(B3<=C3;E3=F3));1;SI(B3<=C3;E3/F3;0))*

    B-->Date BL
    C-->Date Promise
    D--> OTD Prev
    E-->Qté facturée


    F-->Qté cmdé

    Also, as you may see i'm using a french version of microsoft access, this does not the change the usage of these words in English: Below you'll find the meaning for each french word:

    Si-->If
    VraiFaux-->Iff()
    Et--> And
    Ou--> Or

    As long as i can see a working expression in English i shall be able to change it to french.

    Kind regards !

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    If you have a long formula with nested IIFs, try using a Formula for easier reading and debugging...
    Then in the query, you:

    Reply: getMyRate([bidate],[promise date], [otd], [fract], [cmd])

    Code:
    public function getMyRate(pBlDate, pPromDate,pOTD, pFract,pCmd)
    Dim ans
    
    select case true
    Case pBlDate < date()
       Ans = "answer1"
    pcase pPromDate > date()
        Ans = "answer 2"
    
    end select
    
    getMyRate = ans
    end function

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    translating this excel to sql

    =SI(OU(D3=1;ET(B3<=C3;E3=F3));1;SI(B3<=C3;E3/F3;0))*

    would be

    =IIF(d3=1 OR (b3<=C3 AND e3=f3),1,IIF(B3<=C3,e3/F3,0))


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

Similar Threads

  1. Replies: 41
    Last Post: 05-29-2015, 02:58 PM
  2. Replies: 7
    Last Post: 11-06-2014, 10:55 AM
  3. Converting this formula to an access database
    By prabha_friend in forum Queries
    Replies: 1
    Last Post: 07-23-2014, 10:11 AM
  4. Excel Formula into Access Query
    By dr4ke in forum Queries
    Replies: 7
    Last Post: 06-25-2012, 06:46 AM
  5. Replies: 0
    Last Post: 09-03-2009, 01:58 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