home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / p4w_all.zip / TI1284.ASC < prev    next >
Text File  |  1993-03-03  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1284
  9.   VERSION  :  1.0
  10.        OS  :  WIN
  11.      DATE  :  March 3, 1993                            PAGE  :  1/2
  12.  
  13.     TITLE  :  Adding Leading Zeros to a Zipcode Field
  14.  
  15.  
  16.  
  17.  
  18.   This document illustrates how to add leading zeros to a zipcode
  19.   field that is formatted as a numeric data type.  Fields that are
  20.   formatted with numeric data types do not retain leading zeros.
  21.   In order to have zipcode fields that contain zipcodes with
  22.   leading zeros, the zipcode field must be formatted as an
  23.   alphanumeric data type.  The following steps illustrate how to
  24.   restructure a table and change the data type of a zipcode field
  25.   from numeric to alphanumeric, and how to add leading zeros to
  26.   records that have three or four numbers in the zipcode field.
  27.  
  28.   Before making global changes to your table, it is a good idea to
  29.   first make a backup copy.
  30.  
  31.      1.  Change the data type of the Zipcode field from numeric to
  32.          alphanumeric.
  33.  
  34.             a.  Select File | Utilities | Restructure, choose a
  35.                 table name from the Select File list or type in a
  36.                 table name, then left-click on OK or press Enter.
  37.  
  38.             b.  Change the Type of the Zipcode field from N to A,
  39.                 change the Size area of the Zipcode field to 10,
  40.                 then left-click on Save or press Alt+S to save.
  41.  
  42.             c.  In the Restructure Warning dialog box, choose OK
  43.  
  44.      2.  Create a query for your table
  45.  
  46.             a.  Select File | New | Query, left-click on your table
  47.                 name from the Select File list, then choose OK.
  48.  
  49.             b.  In the first line of the query in the Zipcode
  50.                 field, press F5, then type: 4, @@@@, changeto
  51.                 followed by a space (make sure you follow each
  52.                 comma with a space).
  53.  
  54.             c.  Still in the Zipcode field, type "0", type +, press
  55.                 F5, and type 4.
  56.  
  57.             d.  In the second line of the query in the Zipcode
  58.                 field, press F5, then type: 3, @@@, changeto
  59.                 followed by a space (make sure you follow each
  60.                 comma with a space).
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox for Windows                   NUMBER  :  1284
  75.   VERSION  :  1.0
  76.        OS  :  WIN
  77.      DATE  :  March 3, 1993                            PAGE  :  2/2
  78.  
  79.     TITLE  :  Adding Leading Zeros to a Zipcode Field
  80.  
  81.  
  82.  
  83.  
  84.             e.  Still in the Zipcode field, type "00", type +,
  85.                 press F5, and type 3.
  86.  
  87.          Your query should look like the example below:
  88.  
  89.               CUSTLIST╔═══════Zipcode══════════════╗
  90.                       ║ _4, @@@@, changeto "0"+_4  ║
  91.                       ║ _3, @@@, changeto "00"+_3  ║
  92.  
  93.          The "-" preceding 4 and 3 represents an example element.
  94.  
  95.      3.  Run the Query by clicking the Lightning Bolt or press F8.
  96.  
  97.          When Paradox finishes the query, it displays the Changed
  98.          table on the Desktop.  Now open the table that you queried
  99.          to view the changes (in this example you would view the
  100.          table "Custlist").  Records that had only three numbers in
  101.          the Zipcode field will now have two leading zeros
  102.          preceding the three numbers.  Records that had only four
  103.          numbers in the Zipcode field will now have one leading
  104.          zero preceding the four numbers.
  105.  
  106.  
  107.   Suggested Reading:
  108.  
  109.   Restructuring tables: Chapter 9, User's Guide
  110.   Changeto queries: Chapter 6, User's Guide
  111.  
  112.  
  113.   DISCLAIMER: You have the right to use this technical information
  114.   subject to the terms of the No-Nonsense License Statement that
  115.   you received with the Borland product to which this information
  116.   pertains.
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.