Re: Which field to use
- From: "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx>
- Date: Fri, 10 Nov 2006 13:25:22 +0800
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
.
- Follow-Ups:
- Re: Which field to use
- From: Jamie Collins
- Re: Which field to use
- From: Brendan Reynolds
- Re: Which field to use
- References:
- Which field to use
- From: Ana_T
- Re: Which field to use
- From: Brendan Reynolds
- Which field to use
- Prev by Date: Re: Querying the Structure of Tables in a Database
- Next by Date: Re: one to one relationship help and database design question
- Previous by thread: Re: Which field to use
- Next by thread: Re: Which field to use
- Index(es):
Relevant Pages
|