Access 2003 / Update fileds

A

Abay

Hello,

I have a text field to which I would like to add the contents of another
field plus some more text. My update query is as follows:

Left([Desc],28) & [Pubdate] & "*BOOK" (Desc contains a book title)

I wish to add the contents of the field Pubdate starting at position 29 of
the Desc field, and append the *BOOK text after that.

The update works, however the Pubdate, and it's following text are added at
the end of the book title wherever that occurs, i.e. not at position 29,
unless the Title had 28 characters or more.

Any help with this would be most appreciated.

Abay
 
J

John W. Vinson

Hello,

I have a text field to which I would like to add the contents of another
field plus some more text. My update query is as follows:

Left([Desc],28) & [Pubdate] & "*BOOK" (Desc contains a book title)

I wish to add the contents of the field Pubdate starting at position 29 of
the Desc field, and append the *BOOK text after that.

The update works, however the Pubdate, and it's following text are added at
the end of the book title wherever that occurs, i.e. not at position 29,
unless the Title had 28 characters or more.

Any help with this would be most appreciated.

Abay

Pad the Desc:

Left([Desc] & String(28, " "), 28) & [Pubdate] & "*BOOK"

You might want to use the Format() function to cast Pubdate into a consistant
format.

Do note that this value should almost certainly NOT be stored in any table
field, as it can and should be calculated on the fly as needed!
 
A

Abay

Hello again John,

Many thanks for your reply, and of course it worked & it will not ever be
used as a table field, always calculated on the fly, as you say, as needed.

Your help is much appreciated.

Abay

John W. Vinson said:
Hello,

I have a text field to which I would like to add the contents of another
field plus some more text. My update query is as follows:

Left([Desc],28) & [Pubdate] & "*BOOK" (Desc contains a book title)

I wish to add the contents of the field Pubdate starting at position 29 of
the Desc field, and append the *BOOK text after that.

The update works, however the Pubdate, and it's following text are added
at
the end of the book title wherever that occurs, i.e. not at position 29,
unless the Title had 28 characters or more.

Any help with this would be most appreciated.

Abay

Pad the Desc:

Left([Desc] & String(28, " "), 28) & [Pubdate] & "*BOOK"

You might want to use the Format() function to cast Pubdate into a
consistant
format.

Do note that this value should almost certainly NOT be stored in any table
field, as it can and should be calculated on the fly as needed!
 
W

WINGTUNWONG 7707524

Abay said:
Hello,

I have a text field to which I would like to add the contents of another
field plus some more text. My update query is as follows:

Left([Desc],28) & [Pubdate] & "*BOOK" (Desc contains a book title)

I wish to add the contents of the field Pubdate starting at position 29 of
the Desc field, and append the *BOOK text after that.

The update works, however the Pubdate, and it's following text are added
at the end of the book title wherever that occurs, i.e. not at position
29, unless the Title had 28 characters or more.

Any help with this would be most appreciated.

Abay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top