By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,649 Members | 1,601 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,649 IT Pros & Developers. It's quick & easy.

32 bit unsigned integer field?

P: n/a
A Quick question if someone could help, im sure this has been asked
before, but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

Cheers PeteP.

PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.
Nov 13 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
No.

Would 4 byte fields do?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Piper" <No*****@Email.com> wrote in message
news:cm**********@sparta.btinternet.com...
A Quick question if someone could help, im sure this has been asked before,
but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long Integer
because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

Cheers PeteP.

PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.

Nov 13 '05 #2

P: n/a
Peter Piper <No*****@Email.com> wrote in news:cmvjl7$jpc$1
@sparta.btinternet.com:
A Quick question if someone could help, im sure this has been asked
before, but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

Cheers PeteP.

PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.


posted preiously:

As we know decimals can be effected in VBA through their assignment (as a
string seems to be more efficient for long ones then as a number) with the
CDec operator.

They are stored in the 16 bytes of the variant as

byte(0) -> 14 ... the type, ie decimal
byte(1) -> 0 ... seemingly unused
byte(3) -> the number of decimal places
byte(4) -> 0 (positive) or 128 (negative)
bytes(5 - 15) a 48 bit unsigned integer ( ... not the 16 bit integer we
know and love??)

While the help file calls these signed integers they do not seem to be
signed integers in the way a long is a signed integer, that is where the
last (or first depending upon your view point) bit is set to indicate
negativity, while the other bits of that byte hold values. In fact the 48
bits are signed by the preceding byte and are in my opinion, basically
unsigned, as we use signed.

That is 2^32 -1 as a decimal (variant) is 4294967295 while the same bytes
as a long are -1 ... (not to be confused with 2^32-1 as an expression which
is stored as a double.)

Why do I mention this?

Sometimes in programming we want an unsigned integer. I think positive
decimals with zero places of decimals could give us such and I think VBA is
hiding a 48 bit mathematical capability which might prove useful in ... I'm
sure there MUST be something!

--
Lyle
--
use iso date format: yyyy-mm-dd
http://www.w3.org/QA/Tips/iso-date
--
The e-mail address isn't, but you could use it to find one.
Nov 13 '05 #3

P: n/a
The Currency data type is commonly used for this purpose. It is stored as an
8-byte signed integer, decimal-shifted by 4 places. Subtract 1-bit for the
sign, and less than 14-bits for the decimal shift, and that leaves 6 bytes
plus 1 bit. Plenty of overhead left to fit in a 4-byte unsigned value without
problems.

On Thu, 11 Nov 2004 11:50:00 +0000 (UTC), Peter Piper <No*****@Email.com>
wrote:
A Quick question if someone could help, im sure this has been asked
before, but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

Cheers PeteP.

PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.


Nov 13 '05 #4

P: n/a
Steve Jorgensen wrote:
The Currency data type is commonly used for this purpose. It is stored as an
8-byte signed integer, decimal-shifted by 4 places. Subtract 1-bit for the
sign, and less than 14-bits for the decimal shift, and that leaves 6 bytes
plus 1 bit. Plenty of overhead left to fit in a 4-byte unsigned value without
problems.


But you have to be careful to format it whenever it's used else you'll
always get a currency symbol plonked on the front if none is specified,
and I'm sure many will know my feeling on the silliness of that.

--
This sig left intentionally blank
Nov 13 '05 #5

P: n/a
Yes 4 bytes (32 bits) would do if it was unsigned allowing the full
range of +ve numbers possible with 4 bytes.

Allen Browne wrote:
No.

Would 4 byte fields do?

Nov 13 '05 #6

P: n/a
Im not sure what this means, im a delphi programmer.
When i create the fields i want to be able to select Number as the field
type then which ever Number is 32 bits (unisned) however there does'nt
appear to be one?

Lyle Fairfield wrote:
Peter Piper <No*****@Email.com> wrote in news:cmvjl7$jpc$1
@sparta.btinternet.com:

A Quick question if someone could help, im sure this has been asked
before, but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

Cheers PeteP.

PS. 32 bit unsigned integer = Caridnal = DWORD = unsigned LongInt.

posted preiously:

As we know decimals can be effected in VBA through their assignment (as a
string seems to be more efficient for long ones then as a number) with the
CDec operator.

They are stored in the 16 bytes of the variant as

byte(0) -> 14 ... the type, ie decimal
byte(1) -> 0 ... seemingly unused
byte(3) -> the number of decimal places
byte(4) -> 0 (positive) or 128 (negative)
bytes(5 - 15) a 48 bit unsigned integer ( ... not the 16 bit integer we
know and love??)

While the help file calls these signed integers they do not seem to be
signed integers in the way a long is a signed integer, that is where the
last (or first depending upon your view point) bit is set to indicate
negativity, while the other bits of that byte hold values. In fact the 48
bits are signed by the preceding byte and are in my opinion, basically
unsigned, as we use signed.

That is 2^32 -1 as a decimal (variant) is 4294967295 while the same bytes
as a long are -1 ... (not to be confused with 2^32-1 as an expression which
is stored as a double.)

Why do I mention this?

Sometimes in programming we want an unsigned integer. I think positive
decimals with zero places of decimals could give us such and I think VBA is
hiding a 48 bit mathematical capability which might prove useful in ... I'm
sure there MUST be something!

Nov 13 '05 #7

P: n/a
If you create a Number field in an Access table, and set its Size to Byte,
you have no choice. Access only gives you the unsigned byte.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter Piper" <No*****@Email.com> wrote in message
news:cn**********@titan.btinternet.com...
Yes 4 bytes (32 bits) would do if it was unsigned allowing the full range
of +ve numbers possible with 4 bytes.

Allen Browne wrote:
No.

Would 4 byte fields do?

Nov 13 '05 #8

P: n/a
Peter Piper wrote:
Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long
Integer because it is signed can not represent the full range needed
(0..4294967295), neither can Double.


No, there is no 32-bit unsigned field type, but the Decimal type stores 48 bit
signed numbers and the Double type has a 52-bit mantissa, both of which can
accurately hold your 32-bit unsigned numbers.

-Greg.
Nov 13 '05 #9

P: n/a
Gregory Paret wrote:
No, there is no 32-bit unsigned field type, but the Decimal type stores
48 bit signed numbers and the Double type has a 52-bit mantissa, both of
which can accurately hold your 32-bit unsigned numbers.


Correcting myself, the Decimal type stores 96 bit signed numbers.

-Greg.
Nov 13 '05 #10

P: n/a
"Peter Piper" <No*****@Email.com> wrote in message
news:cm**********@sparta.btinternet.com...
A Quick question if someone could help, im sure this has been asked before,
but googling is getting me now where slowly.

Is it possible to get an unsigned 32 bit integer field in Access.

Im storing IP address in their integer form (ie. 32 bits) and Long Integer
because it is signed can not represent the full range needed
(0..4294967295), neither can Double.

Any suggestions please?

I would store each octet in it's own column with data type Tinyint.
Nov 13 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.