Add new fields in an update query

zhuanyi

Registered User.
Local time
Today, 14:52
Joined
Apr 24, 2007
Messages
66
Hi,
i am just wondering is there any chance I could add in new fields (columns) in an update query?
Thanks!
 
No, you would need to use code for an Alter Table SQL statement. But, if you are doing this, then I submit that the liklihood is that your design is flawed as you really shouldn't need to be adding columns.

Why are you adding columns?
 
thanks for the quick reply.
the reason is some of the results are calculated based on the selection results in the previous query. say for example, in the previous query, I selected the age of people, and now I want to categorize them so that if age >60 => senior, age < 20 => children, and otherwise adults and so on. the queries have to be separated for the sake of clarity.
could you help me with that? thanks!
 
You can use queries in place of tables in a query. So query1 can select data and created calculated fields. Query2 can reference query1, including the calculated fields.
 

Users who are viewing this thread

Back
Top Bottom