If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Adding a character in front of a field
|
#2
|
|||
|
|||
Adding a character in front of a field
Hi, Sunny.
1.) Create a new field in your table, called reference_if. 2.) Create a new query and open the SQL View pane and write a SQL statement such as the following: UPDATE myTableName SET reference_if = "H" & expense_id; 3.) Run the query. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. "Sunny Sethi" wrote in message ... Hi, In a table I have 1 field(expense_id) which is a auto- number field. I want to create another field using the same value as the (expense_id) BUT appending H in front of it. e.g. expense_id - value = 1 refernce_if - value = H1 Thanks Sunny |
#3
|
|||
|
|||
Adding a character in front of a field
NO! That's a violation of relational database theory: a field in a table
should not be totally derivable from other fields in the table. Instead, create a query that has a computed field reference_if: "H" & expense_id, then use the query wherever you would otherwise have used the table. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "'69 Camaro" wrote in message ... Hi, Sunny. 1.) Create a new field in your table, called reference_if. 2.) Create a new query and open the SQL View pane and write a SQL statement such as the following: UPDATE myTableName SET reference_if = "H" & expense_id; 3.) Run the query. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. "Sunny Sethi" wrote in message ... Hi, In a table I have 1 field(expense_id) which is a auto- number field. I want to create another field using the same value as the (expense_id) BUT appending H in front of it. e.g. expense_id - value = 1 refernce_if - value = H1 Thanks Sunny |
#4
|
|||
|
|||
Adding a character in front of a field
Thanks, Doug, for that very important reminder! I forgot to mention it in
my earlier post, obviously. However, there are a few reasons to temporarily (or permanently) violate the rules of relational database theory, such as when the need arises to match table structures or to improve the performance of queries. The bottom line is that one needs to be fully grounded in proper relational database theory, and then know when relational database rules can be bent. Gunny "Douglas J. Steele" wrote in message ... NO! That's a violation of relational database theory: a field in a table should not be totally derivable from other fields in the table. Instead, create a query that has a computed field reference_if: "H" & expense_id, then use the query wherever you would otherwise have used the table. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "'69 Camaro" wrote in message ... Hi, Sunny. 1.) Create a new field in your table, called reference_if. 2.) Create a new query and open the SQL View pane and write a SQL statement such as the following: UPDATE myTableName SET reference_if = "H" & expense_id; 3.) Run the query. HTH. Gunny See http://www.QBuilt.com for all your database needs. See http://www.Access.QBuilt.com for Microsoft Access tips. "Sunny Sethi" wrote in message ... Hi, In a table I have 1 field(expense_id) which is a auto- number field. I want to create another field using the same value as the (expense_id) BUT appending H in front of it. e.g. expense_id - value = 1 refernce_if - value = H1 Thanks Sunny |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
adding text in a currency field | Linda | Database Design | 4 | June 7th, 2004 07:10 PM |
Adding character to text string | Adam | Worksheet Functions | 2 | September 25th, 2003 08:58 AM |
Adding character to text string | Rekoj | Worksheet Functions | 0 | September 24th, 2003 10:40 PM |