Check if values exist then insert new fields

Zandra

Registered User.
Local time
Today, 15:48
Joined
Mar 13, 2009
Messages
30
Hi,
I have a field called Quarter_Key. If the values in this field are like 200601, 200602, 200603, 200604, 200701, 200702, 200703, 200704 and so on....
Then I want to insert a new fields based on the values. For instance, if the values that are found in the Quarter_Key are 200601, 200602, 200603, 200604 then I want to insert a new field and name the field COY. Also do another check again, if there are other values that are f in the Quarter_Key are like 200701, 200702, 200703, 200704 then I want to insert a new field and name the field CY07. So probably after I run the query I will end up having some new fields like COY, CY07, CY08 and etc. Thanks for your help.
 
It is possible to do what you ask. The problem is that you probably should not be doing it.

If this is for generating a report or for temporary storage and discarded when done, I would say it is

If this is for long term storage of the data, then you should not be adding fields. This violates the rules of data normalization by creating repeating fields. You would create a new record each time for each year. This will give you a lot more flexibility in the future.
 
can you tell me how would l do that? thanks
 
I am not sure which option you are asking how to do. Which method do you need help with?
 

Users who are viewing this thread

Back
Top Bottom