Getting numbers into boxes

  • I have stored in my database bank account numbers and gst numbers for clients.  How am I able to get them to populate onto my forms in separate boxes.

    There are fifiteen numbers for each bank account and I need to get each number in one box.

     

     

     

  • You could do something like this ugly bit of code,

    DECLARE @acc char(15)
    SET @acc = '1234567890ABCDE'
    SELECT 
     @Acc as Account
     , SUBSTRING(@acc, 1, 1) as Char1
     , SUBSTRING(@acc, 2, 1) as Char2
     , SUBSTRING(@acc, 3, 1) as Char3
     , SUBSTRING(@acc, 4, 1) as Char4
     , SUBSTRING(@acc, 5, 1) as Char5
     , SUBSTRING(@acc, 6, 1) as Char6
     , SUBSTRING(@acc, 7, 1) as Char7
     , SUBSTRING(@acc, 8, 1) as Char8
     , SUBSTRING(@acc, 9, 1) as Char9
     , SUBSTRING(@acc, 10, 1) as Char10
     , SUBSTRING(@acc, 11, 1) as Char11
     , SUBSTRING(@acc, 12, 1) as Char12
     , SUBSTRING(@acc, 13, 1) as Char13
     , SUBSTRING(@acc, 14, 1) as Char14
     , SUBSTRING(@acc, 15, 1) as Char15

    But realistically this is something that should be done in the presentation layer, ie: the application not the database engine.

    The database would server up the account number as a single field and then your application slices and dices as necessary.

     

     

    --------------------
    Colt 45 - the original point and click interface

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply