inserting character in an access field by using an update query 
Author Message
 inserting character in an access field by using an update query

Hi,
What function do I use to insert a character in a field.
ie. 123456789 How would I insert a dash after the #3 and
after the #5.
Thank you for your help


Tue, 20 Sep 2005 03:34:07 GMT  
 inserting character in an access field by using an update query

Quote:

>Hi,
>What function do I use to insert a character in a field.
>ie. 123456789 How would I insert a dash after the #3 and
>after the #5.
>Thank you for your help

Assuming that the positions are static and the length of the string is
static.

    Dim str As String
    str = "123456789"

    Left(str,3) & "-" & Mid(str,4,2) & "-" & Right(str,4)

- Jim



Tue, 20 Sep 2005 07:25:19 GMT  
 inserting character in an access field by using an update query
The easiest way is to use the format function:

format("123456789","000-00-0000")

Quote:
>-----Original Message-----
>Hi,
>What function do I use to insert a character in a field.
>ie. 123456789 How would I insert a dash after the #3 and
>after the #5.
>Thank you for your help
>.



Wed, 21 Sep 2005 00:22:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using Update to update an Access field

2. Update and Insert queries work in SQL but not in Access

3. Dialog box displayed during query insert or query update

4. Populating memo field using update query from VB5

5. Insert works in Access query window but not from VB using JET 4.0

6. Insert column/field using Access Automation - how??

7. Geting back the autonumber field in VB5 when inserting into access v7.0 using ODBC

8. Using ADO Command object and Access PROCEDURE to insert Memo/Binary fields

9. Access Database using update query - Help

10. How to Update Access queries using VB code

11. How to Update Access queries using VB code

12. Can't update sorted access query from vb6 using ado

 

 
Powered by phpBB® Forum Software