Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2008
    Posts
    4

    Unanswered: Increment HexDecimal Values

    Hi,

    I have to increment Hexadecimal values which is of type NVARCHAR.
    for Eg. 123A
    This value has to be incremented 6 times.
    as
    123B
    123C
    124D
    124E
    124F
    1250

    I would appreciate if get some help.

    Thanks & Regards
    BindhuM

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Can you store binary instead? Makes it lots easier to increment
    George
    Home | Blog

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    I forget the details.. the manuel should be able to help
    it should be possible to cast the hex value to an integer do your arithmatic and save the resultant value using the hex function

    you could also do a similar approach depending on your front end
    IIRC you can also directly assign hex values to intger datatypes (presumably integer and biginteger
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Is there a reason that you don't store this as an integer or decimal value which would make your task much easier? Do you need to produce each of the six values, or only the final value? What is your input range (largest and smallest values)?

    -PatP

Posting Permissions

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