Re: changing the decimal to hex
- From: "John Spencer" <spencer@xxxxxxxxx>
- Date: Fri, 5 Oct 2007 08:33:52 -0400
If the user is storing the Hex numbers with the &H prefix then my solution
would be
IIF(IsNumeric([TheField]),"&H" & Hex(CLng([TheField])),Null)
That changes the number to its base 10 equivalent and then changes that to
its hex equivalent. But if the number is not being stored with the prefix,
there is no way to handle the ambiguity inherent with 9836.
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
"Jamie Collins" <jamiecollins@xxxxxxxxxx> wrote in message
news:1191583087.270716.121480@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Oct 4, 5:59 pm, John W. Vinson <jvinson@xxxxxxxxxxxxxxxxxxxxxxxxxx>
wrote:
If your field contains the string "1FA3" then it's clearly hex... but
what if
it contains "9836"? Is that decimal 9836 ('x266C') or is it hex 9836
(38966),
and how on Earth can you tell?
Didn't you just answer your own question there? i.e. formatting
(&H0000266C&, &H266C&, etc).
I think the question is, why isn't the OP storing values using a
numeric type?
Jamie.
--
.
- References:
- changing the decimal to hex
- From: mohsin via AccessMonster.com
- Re: changing the decimal to hex
- From: John W . Vinson
- Re: changing the decimal to hex
- From: Jamie Collins
- changing the decimal to hex
- Prev by Date: Re: Problem with Concatenate Function
- Next by Date: Re: Anything beginning with "aim"
- Previous by thread: Re: changing the decimal to hex
- Next by thread: Duplicated date
- Index(es):
Relevant Pages
|