Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting in Queries (A2K)

    When I use the field ([GCO - Phone]) by itself and formatted (000") "000-0000;;_
    it prints out as (555) 123-4567

    However, if I try a query field like PrintPhone: "Phone: "+([GCO - Phone])
    it comes out as Phone: 5551234567

    The same problem exists when I try using the same scenario for a postal code.
    [GCO Postal Code] by itself and formatted >L0L" "0L0
    prints out as M3H 1Q4, but if used like PostalCode: "PC: "+([GCO PostalCode], I get PC: M3H1Q4.

    I think I've done this correctly before, but as usual, can't find it when I need it.

    Would appreciate any help on this
    Cheers,
    Andy

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Formatting in Queries (A2K)

    Calculated expressions ignore the formatting of fields, they use the stored value. To get around this, you can use the Format function, for example:
    <code>
    PrintPhone: "Phone: " & Format([GCO - Phone],"(000) 000-0000")
    </code>
    and
    <code>
    PostalCode: "PC: " & Format([GCO - PostalCode],"@@@ @@@")</code>

  3. #3
    5 Star Lounger
    Join Date
    Nov 2001
    Location
    Toronto Canada
    Posts
    920
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Formatting in Queries (A2K)

    Thanks Hans, appreciated as always. I know for sure that you answered this same question for me before, but as usual, couldn't find it when I needed it,
    Cheers,
    Andy

Posting Permissions

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