Zip Code Formats - SSRS

Former Member
Former Member $organization

Hello All,

I need to display zip codes in an SSRS report. It is complicated because the format is different for different countries. The only thing I have found is to deal with the formatting in the Excel spreadsheet when the data is exported. I can convert the cells to a Number format and then define the format as Special and Zip Code + 4. Is there a better way?

 

Gloria

Parents
  • Hi Gloria,

    If you have access to the report in SQL, there is a handy built in function AF_FORMAT_STRING which should help you out. The function handles postal codes for whatever country the address is from.

    Here's a quick sample on how to use it:

    SELECT [dbo].AF_FORMAT_STRING(a.postal_code, c.zip_mask)
    FROM   [dbo].T_ADDRESS a
    LEFT JOIN [dbo].TR_COUNTRY c ON a.country = c.id 

    Hope that helps a bit!



    [edited by: Paul Kappel at 10:51 AM (GMT -6) on 11 Nov 2014]
Reply
  • Hi Gloria,

    If you have access to the report in SQL, there is a handy built in function AF_FORMAT_STRING which should help you out. The function handles postal codes for whatever country the address is from.

    Here's a quick sample on how to use it:

    SELECT [dbo].AF_FORMAT_STRING(a.postal_code, c.zip_mask)
    FROM   [dbo].T_ADDRESS a
    LEFT JOIN [dbo].TR_COUNTRY c ON a.country = c.id 

    Hope that helps a bit!



    [edited by: Paul Kappel at 10:51 AM (GMT -6) on 11 Nov 2014]
Children
No Data