Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: Truncate characters in a column

  1. #16
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    you could use integer as well. For faster searches integer is better.

    create table zip(zipcode int)

    insert into zip select 07054
    insert into zip select 08620

    --search
    select * from zip where zipcode =08620
    select * from zip where zipcode =07054

    For displaying on the reports you could add a leading zero if the length is 4.

  2. #17
    Join Date
    Aug 2005
    Posts
    31
    Great, thank you rmiao!

Posting Permissions

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