Results 1 to 6 of 6
  1. #1
    Albert is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Location
    Sydney
    Posts
    9

    Using IF in query builder

    Hello I have an excel formula

    =IF(D2<=100,44, ROUNDUP((D2/50),0)*22)

    that I wish to use in a query using [WordCount] in place of D2 giving me a number as the result


    Using the IIF function
    IIf([WordCount]<=100,44,(Round(0) [WordCount]/50*22))

    I cant get the expression right using the expression builder, can some one assist me please
    Albert

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Is this what you meant?

    IIf([WordCount]<=100,44,Round([WordCount]/50*22,0))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Albert is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Location
    Sydney
    Posts
    9
    Perfect thanks its works just as I wanted to
    thyats helped me out a lot
    thanks A

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    No problem. If you end up needing a round up, Allen has some ideas:

    http://allenbrowne.com/round.html
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Albert is offline Novice
    Windows Vista Access 2007
    Join Date
    Apr 2013
    Location
    Sydney
    Posts
    9
    sorry your answer does work but not as I wanted
    I want to round up the (WordCount divided by 50) to the next full interger and then multiply that number by 22

    I still cant get the bracket in the right place
    thanks
    A

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Did you review Allen's method?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Query Builder want to filter by Check Box
    By crimedog in forum Queries
    Replies: 2
    Last Post: 01-15-2020, 03:32 PM
  2. Macro Builder and Code Builder
    By data808 in forum Macros
    Replies: 2
    Last Post: 01-12-2014, 11:28 AM
  3. Grouping and Addiing using Query Builder
    By GAccess in forum Queries
    Replies: 4
    Last Post: 05-22-2012, 02:10 PM
  4. Run Query in Macro Builder
    By chewbears in forum Queries
    Replies: 0
    Last Post: 11-21-2011, 09:18 AM
  5. sql query builder and tables
    By benjammin in forum Queries
    Replies: 1
    Last Post: 05-28-2011, 02:11 AM

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