Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combining Fields in a Query, format Question (Access 97)

    In the one table in this database there are 3 fields, Medication, Dose, Units. An example record would be: Epogen 10,000.00 Units. In the one query, we want to combine the three fields into one record, and have used the following expression:

    Expr1: [Table1]![Medication] & " " & [Table1]![Dose] & " " & [Table1]![Units]

    However, when the information is displayed, it displays the Dose without the comma and decimal places in the query, even though that shows up in the table itself (as in the table example above). Example of display in Query: Epogen 10000 Units

    Is there a way to get the formatting of that cell to still appear when it's being concatenated?

    Thanks,

    Kelley

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Combining Fields in a Query, format Question (Access 97)

    Hi Kelley,
    Try this:
    Expr1: [Table1]![Medication] & " " & format([Table1]![Dose], "#,##0.00") & " " & [Table1]![Units]
    and you should get what you want.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Star Lounger
    Join Date
    Jan 2001
    Posts
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combining Fields in a Query, format Question (Access 97)

    That did it! I just wasn't sure if you could add the formatting in the expression, but now I know that you can. Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •