Field for variable formats

J

Johnathon Anderson

I am a physics teacher and am trying to complete a database for my students
so they can log the amount of energy created by the sun at various stages
throught the year. I hope to show and record other star's energy at a later
stage.

As the energy creation is variable I need to have a field in my table (that
will be the basisi of a form control) that is variable. That is it needs to
hold both whole numbers and percentages as the creation is a part of the
total output for a year

eg
Total creation = 1000
1/1/2008 = 2 parts
2/1/2008 = 3.4 parts
etc

examples of the number data would be
1
2.452
3
3.2%
5.78%
6
3.23
etc

I have tried for many hours to get this work and I have not have any luck.
 
W

Wayne-I-M

It will never work

There is no "formating" you can use that tell you students what you are
teaching is just plain wrong.

No doubt when they fail the exam you will say it it's not your fault and if
only they had paid attention etc etc etc

+++++++++++++++++
The sun does NOT create anything
+++++++++++++++++

and even if it did you can not allocate a percentage to quanta
 
J

Johnathon Anderson

Of course it does.

Here is a definition from Dicconary.com

to be the cause or occasion of; give rise to

So the sun and other star "create" sun-light

Well it did last time I looked up anyway
 
W

Wayne-I-M

N o i t d o e s n ' t

Have you ever heard of the 1st law of Thermodynamics ?

The sun does NOT create energy

If you don't understand the process
1st stop teaching about it
2nd learn to understand the conservation of energy principle
3rd Read this
About half way down the page you will find out how the sun emits (not
creates) energy

http://www.folgarida.co.uk/Folgarida_articles_SnowOnMountain.htm

Oh - your 1st post by the way (after you have amended your lessons)
Use a Text formated field
In a query ( Like"*"%)
Use a right split to get the "text" before the %
Convert the Text to a number
Use in calculations to give the "packets" NOT, NOT, NOT percentages

If you don't understand energy packets ...... well then

:)
 
K

Klatuu

The point is regardless of how you see if from your scientific perspective,
it doesn't work that way in a database perspective. A field is a field that
is defined as a specific data type. Percentage is not a data type. In an
Access database, it is one predefined format type that present a numeric
value as a percentage. For example, if you use the percentage format.
For example:
?format(.259,"percent") will return 25.90%
But, then so will format(2590/100, "0.00\%")

Now, the issue is, with only a numeric value in the field, you application
has no way of knowing how to treat the number for any specific row.

You will have to do one of two things.

1. Use two different fields for each row. One representing a number and the
other a percentage (it would also be a numeric field). The difficulty with
this approach is the opportunity for errors and confusiont.

B. Include a Boolean field in your table and a checkbox on the form to
indicate whether to treat the number as a number or a percentage.


Those are your options. I know of no database that as a "variable" data type.
I did think of perhaps using whole numers as percentages and decimal numbers
as numbers, but because Access, like almost every database engine, might
store a whole number with an infitisimal percentage, it would probably not
work correctly.

So, you help us keep track of solar output and we will help you with
database design.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top