Results 1 to 4 of 4
  1. #1
    RobFlott is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2015
    Posts
    22

    Using Builder to identify a price in a separate field, if there is a price in that field.

    My database has a field 'Offer Description' which may or may not include a price, for example $29.99. I have a query where I want to identify the price in a new field called 'Quantity Discount Price'.

    Using Builder I tried writing numerous expressions that will result in the 5 or 6 character price (ex $7.99 or $29.99), if there is a price associated with that record in the 'Offer Description' field, but with no luck:

    QD Price: IIf([Offer Description] Like '*$*',Right$('$'+5),"")



    Can anyone point me in the right direction and where my expression is wrong?

    Thank you,

    Rob

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What does 'no luck' mean - error message, wrong result, nothing happens?

    QD Price: IIf([Offer Description] Like "*$*", Val(Mid([Offer Description], InStr([Offer Description], "$")+1)), Null)


    Recommend no spaces nor punctuation/special characters (underscore only exception) in naming convention.
    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
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Rob,

    Tell us a little more about your application in simple English -no database or jargon. Once readers understand the issue they may provide more focused responses.
    Prices are typically numbers that can be added/subtracted etc. Putting such "prices" within text strings does not offer any chance of arithmetic, unless you separate out the "numbers".
    Good luck with your project.

  4. #4
    RobFlott is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    May 2015
    Posts
    22
    What does 'no luck' mean - error message, wrong result, nothing happens?

    'no luck' meant wrong result.

    Your input solved my issue,

    Thank you for your help

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

Similar Threads

  1. Order Entry Form - Case Price vs. Unit Price
    By Kaloyanides in forum Access
    Replies: 4
    Last Post: 05-18-2017, 06:31 AM
  2. Replies: 17
    Last Post: 12-14-2015, 10:23 PM
  3. Replies: 5
    Last Post: 11-23-2014, 03:54 PM
  4. Replies: 2
    Last Post: 12-27-2013, 05:20 PM
  5. Item without price, or duplicate price
    By Auto in forum Reports
    Replies: 5
    Last Post: 07-29-2013, 09:46 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