By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,445 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

Moving column

P: 52
How to move the last column to as first column. Im using microsoft access 2000. Please guide me in syntax because im doing a tools to update my database.
Apr 28 '08 #1
Share this Question
Share on Google+
9 Replies


Expert Mod 2.5K+
P: 2,545
Hi. We cannot help you from what you have told us so far - please provide more detail. In particular:

If you are referring to a table or query, what is the metadata (the field names and types) for that table or query?

What do you mean by 'Column'? Do you mean a specific field in your table, or a specific row (record)? Or are you referring to a form?

It is impossible to give you any form of positive answer to your question at present.

Please read the POSTING GUIDELINES to assist you.

-Stewart

How to move the last column to as first column. Im using microsoft access 2000. Please guide me in syntax because im doing a tools to update my database.
Apr 28 '08 #2

P: 52
it like tis i want to add a field in the table but usually it just append at table. I want the field to be added as a first field. My query was not worked.

ALTER TABLE alternator ADD AltID Numeric FIRST
Apr 28 '08 #3

Expert Mod 2.5K+
P: 2,545
Hi. You are still providing very little information, but I think I understand what you are trying to achieve. You are confusing the physical field order in the table with the sequence of what you display to users. The ALTER TABLE statement cannot change the physical order of the fields in your table - nor does it need to. Use it to add new fields as necessary, then show them using a SELECT statement in whatever order you want, i.e.

SELECT ALTID, Field2, Field3 ... FieldN from Alternator;

-Stewart

it like tis i want to add a field in the table but usually it just append at table. I want the field to be added as a first field. My query was not worked.

ALTER TABLE alternator ADD AltID Numeric FIRST
Apr 28 '08 #4

P: 52
I want to change the physical order of the fields actually. Please help me to do it by query.
Apr 29 '08 #5

missinglinq
Expert 2.5K+
P: 3,532
Why do you want to change the field order? As Stewart tried to explain, the order of a given column in your table doesn't matter in the least. The order can be controlled when the data is displayed thru forms or queries, which is the only way end users should be allowed to access the data.

Linq ;0)>
Apr 29 '08 #6

P: 52
I know but i wan the altid at begining of the table. i just wan the query....my boss want it.....so i had 2 follow him....so i need the query....plzzzzzz
Apr 29 '08 #7

FishVal
Expert 2.5K+
P: 2,653
I know but i wan the altid at begining of the table. i just wan the query....my boss want it.....so i had 2 follow him....so i need the query....plzzzzzz
Though it has little sense and I completely agree with Stewart and Linq, you may take this as a challenge and try to play with Field.OrdinalPosition property adding a field via DAO in VBA code. But be aware that setting field being appended OrdinalPosition value will not change OrdinalPosition values of the fields already existing in the table. After this operation you will have two fields with OrdinalPosition=0, the order they appear in the table will be defined by alphabetical sorting.

Regards,
Fish
Apr 29 '08 #8

P: 52
I am not understand .
Apr 29 '08 #9

Expert Mod 2.5K+
P: 2,545
Hi. To be clear:

1. SQL code cannot alter the physical sequence of fields in a table definition
2. there is no reason to do so anyway, as you can provide virtual views of the fields in a table in any suitable order using SELECT and CREATE VIEW statements in SQL, and through the use of Access forms and reports for users
3. if you want to alter the physical ordering of fields in a table definition you can alter the ordinal position properties of the fields in the table definition as Fish has advised. This can only be done using VBA code; it cannot be done in SQL.
4. if you are not familiar with VBA and do not have sufficient understanding of the Data Access Objects (DAO) provided in VBA to manipulate recordsets, table definitions and so on you are not really in a position to take any of this further.

I hope you found the assistance provided useful. For me personally there is no more I can do to help you.

Regards

Stewart
Apr 29 '08 #10

Post your reply

Sign in to post your reply or Sign up for a free account.