Re: Which field to use



Brendan, I agree with your approach of using the 4 number fields.
It's atomic, and handles different types of domains sensibly.

I usually use Byte rather than Integer though.

And I usually add a validation rule to the *table* (not the fields) that
says it's all-or-nothing across the 4, i.e.:
(([IP1] Is Null) And ([IP2] Is Null) And ([IP3] Is Null) And ([IP4] Is
Null))
OR (([IP1] Is Not Null) And ([IP2] Is Not Null) And ([IP3] Is Not Null)
And ([IP4] Is Not Null))

--
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.

"Brendan Reynolds" <brenreyn@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:uCULJLEBHHA.144@xxxxxxxxxxxxxxxxxxxxxxx
I would use four integer fields and concatenate them when required ...

SELECT [IPA] & "." & [IPB] & "." & [IPC] & "." & [IPD] AS IP
FROM tblTest
ORDER BY tblTest.IPA, tblTest.IPB, tblTest.IPC, tblTest.IPD;


--
Brendan Reynolds
Access MVP


"Ana_T" <nospam@xxxxxxxxx> wrote in message
news:OHxjomCBHHA.1220@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I need to store the web visitor's IP in a field. I thought of creating a
numeric field but I've been told that because the IP has numbers and dots
should be stored as text. However, if I choose text I cannot group by it.
What's your opinion?
Of course...newbie here.
TIA
Ana


.



Relevant Pages

  • Re: Copy a record to a new record in the same table with a button on form
    ... Allen Browne - Microsoft MVP. ... Perth, Western Australia ... Tips for Access users -http://allenbrowne.com/tips.html ...
    (comp.databases.ms-access)
  • Re: Combo box
    ... Perth, Western Australia ... Tips for Access users - http://allenbrowne.com/tips.html ... I put a combo box in my form as the input data. ...
    (microsoft.public.access.forms)
  • Re: Prefix to Autonumber
    ... Allen Browne - Microsoft MVP. ... Perth, Western Australia ... Tips for Access users - http://allenbrowne.com/tips.html ...
    (comp.databases.ms-access)
  • Re: Find thread on Best match for names
    ... Perth, Western Australia ... Tips for Access users - http://allenbrowne.com/tips.html ... Though the Soundex algorithm is interesting, it is not quite what I am ...
    (comp.databases.ms-access)
  • Re: Combo box
    ... Perth, Western Australia ... Tips for Access users - http://allenbrowne.com/tips.html ... I put a combo box in my form as the input data. ...
    (microsoft.public.access.forms)