Default Value for Table

  • Thread starter Thread starter Zack Barresse
  • Start date Start date
Z

Zack Barresse

Hello everyone,

I have a question regarding a default value for a table. This table has 19 fields, most of which do not get entered every record, which they contain a default value of 0, which suits me just perfect. There are, however, a couple of fields which I want to conditionally change the default value for.

The field in question is called "Top_Casing" and it's default value should look something like this:
Look at "Well" field and "SampleDate" field, find the last date of just those "Well"s and return the last "Top_Casing" value prior to the entry that is being put in.

Here is an example of the data...

Well SampleDate Top_Casing
MW 1 03/01/05 350.5
MW 1 06/01/05 350.5
MW 1 09/01/05 350.5
MW 2 03/01/05 322.0
MW 2 06/01/05 322.0
MW 2 09/01/05 323.0
MW 3 03/01/05 312.75
MW 3 06/01/05 313.75
MW 3 09/01/05 313.75

So if I was entering a value for "Well" MW 2, the default value would change to "323.0", and if I were entering a value for "Well" MW 3 the default value would change to "313.75".

Does this make sense? I hope so. Don't know if this is the way to go about it, but basically this value is pretty much constant but will only *possibly* change rarely on occasion over the course of a few years. Thanks for any help anybody can give me on this. If more info is needed, let me know.
 
Oh, btw, I do have a seperate table which has the Wells listed (as unique, no duplicates) and their associated "Top_Casing" value. Should I use this and update it as necessary? Will it update for me and save my past records if I do that?

--
Regards,
Zack Barresse, aka firefytr
To email, remove NOSPAM

Hello everyone,

I have a question regarding a default value for a table. This table has 19 fields, most of which do not get entered every record, which they contain a default value of 0, which suits me just perfect. There are, however, a couple of fields which I want to conditionally change the default value for.

The field in question is called "Top_Casing" and it's default value should look something like this:
Look at "Well" field and "SampleDate" field, find the last date of just those "Well"s and return the last "Top_Casing" value prior to the entry that is being put in.

Here is an example of the data...

Well SampleDate Top_Casing
MW 1 03/01/05 350.5
MW 1 06/01/05 350.5
MW 1 09/01/05 350.5
MW 2 03/01/05 322.0
MW 2 06/01/05 322.0
MW 2 09/01/05 323.0
MW 3 03/01/05 312.75
MW 3 06/01/05 313.75
MW 3 09/01/05 313.75

So if I was entering a value for "Well" MW 2, the default value would change to "323.0", and if I were entering a value for "Well" MW 3 the default value would change to "313.75".

Does this make sense? I hope so. Don't know if this is the way to go about it, but basically this value is pretty much constant but will only *possibly* change rarely on occasion over the course of a few years. Thanks for any help anybody can give me on this. If more info is needed, let me know.
 
Back
Top