ClanKiller.com
http://forums.clankiller.com/

database design: input mask
http://forums.clankiller.com/viewtopic.php?f=8&t=692
Page 1 of 1

Author:  derf [ Thu Feb 05, 2004 3:39 am ]
Post subject:  database design: input mask

Hello.

How do i CREATE an input mask in MS Access so that the field must have 3 integers followed by either MB, GB?

Basically i need a field that cointains the size/capacity of a computer component like a HD or a stick-o-RAM.

Any ideas?

Thanks.

p.s. so fare all i can design is "999LL" which means 3 numbers and 2 letters.

Author:  Pig [ Thu Feb 05, 2004 7:05 am ]
Post subject: 

I would pick one size, and stick to it. You are asking for trouble if you allow different unit sizes in the same column. That would also removed the need to have a unit on the end at all.

Author:  derf [ Thu Feb 05, 2004 10:21 am ]
Post subject: 

one size as in "999XX"?

Author:  Pig [ Thu Feb 05, 2004 11:35 am ]
Post subject: 

I would store just the number. Then you can either remember that it is GB, or put that in the col name. Such as: table_memory_gb or table_memory_mb. It's kind of hard to say without seeing your entire scheme. It could be that your data is not properly normalized.

Regardless, you should never have mixed units in the same field. You should store the data in a fixed format, and the alter how it is displayed (not how it is stored). Hope that makes sense.

This kind of stuff is a pain in the ass with access. :( In PHP, you could easily take the number, do a test to see whether it's size would be better displayed in GB or MB, and then display it appropriately. You can still do that with access, but you have to dig into the VB of the report.

Author:  derf [ Fri Feb 06, 2004 12:48 pm ]
Post subject: 

Pig wrote:
It could be that your data is not properly normalized.


How dare you! My DB is fully normalised to 3rd Normal Form.

If i create a new field ("mb_or_gb") then this would cause the renound problem of "repeating fields" which is bad database design practice.

In any case i seem to be developing a solution with VB coding.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/