Results 1 to 4 of 4

Thread: Crystal Reports- How to print City,State, Zip in one line?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    19

    Crystal Reports- How to print City,State, Zip in one line?

    Hi,

    I am using the following formula to print City, State, and Zip in a single line.

    Trim ({tblInvoiceRpt.City})+", "+Trim ({tblInvoiceRpt.State})+" - " +
    ToText({tblInvoiceRpt.Zip})


    The result I get is -

    Moorseville, NC - 45,677.00

    The Zip code is displayed with decimal places. How to rectify this? Please help.

    Thanks,
    Ruvi

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Crystal Reports- How to print City,State, Zip in one line?

    Why are you storing Zip code as a numeric? It should be stored as text in the database (as and example in nNH the zips all start with 0 (zero) so Dover NH is 03820. IF stored as a numeric then you wold store 3820 which is not the correct zip).
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    Hyperactive Member NPassero's Avatar
    Join Date
    May 2007
    Location
    NJ
    Posts
    272

    Re: Crystal Reports- How to print City,State, Zip in one line?

    I believe it is
    Code:
    ToText({tblInvoiceRpt.Zip}, 0, "")
    no decimals, and no formatting
    Last edited by NPassero; Jun 19th, 2007 at 08:58 AM.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2007
    Posts
    19

    Re: Crystal Reports- How to print City,State, Zip in one line?

    Thank u ppl,

    As per ur suggestion, I am storing zip code as text in the database

    Ruvi

Posting Permissions

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



Click Here to Expand Forum to Full Width