Results 1 to 4 of 4

Thread: Small Calculation - Urgent help

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Sri Lanka
    Posts
    9

    Small Calculation - Urgent help

    Please give us the coding to genarate this calculation.

    00001,00002,00003..................00009,00010,00011,..........00100

    Najath

  2. #2
    khalik
    Guest

    Re: Small Calculation - Urgent help

    Originally posted by Najath
    Please give us the coding to genarate this calculation.

    00001,00002,00003..................00009,00010,00011,..........00100

    Najath
    if using SQL server try this
    assuming empid is prefix with char E0001.

    select replicate('0',(5-len(right(em_id,4)),(cast(right(em_id,4) as numeric)+1) from emp

  3. #3
    Hyperactive Member
    Join Date
    Jun 2000
    Posts
    350
    In VB, you can use Format to make the string have the 5 digits you need, like this:

    VB Code:
    1. Private Sub CommandNumbers_Click()
    2. Dim myNum As Integer
    3. For myNum = 1 To 100
    4.     Debug.Print Format(myNum, "00000")
    5. Next
    6. End Sub
    .

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Sri Lanka
    Posts
    9

    Thumbs up Thanks

    Hi Jim

    Hey man it's working. Thanks a lot.

    Najath


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