[AccessD] Save a concatenate to another field

Gustav Brock gustav at cactus.dk
Tue Feb 25 01:23:58 CST 2014


Hi Kathryn

The query ran without a glitch, so what is your problem?
However, as most of the secondary fields are empty, you should adjust your SQL to prevent spaces:

UPDATE Genealogies 
SET Genealogies.Title = [TitleProper] & (" " + [SecondaryTitle]) & (" " + [SubTitle]);

/gustav


-----Oprindelig meddelelse-----
Fra: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] På vegne af Kathryn Bassett
Sendt: 25. februar 2014 08:12
Til: 'Access Developers discussion and problem solving'
Emne: Re: [AccessD] Save a concatenate to another field

That didn't work.
BTW, there are no TitleProper's that are Null, just SecondaryTitle & SubTitle

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd- 
> bounces at databaseadvisors.com] On Behalf Of Stephen Bond
> Sent: 24 Feb 2014 9:49 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Save a concatenate to another field
> 
> Make an update query with one field, Title.
> 
> In the 'Update To' row, put : [TitleProper]& " " & [SecondaryTitle] & " " & [SubTitle]
> 
> A thought - if [TitleProper] is Null you'll get a leading space in the [Title] field.
> You might want to investigate using the + concatenation operator 
> instead of the &. For example, ([TitleProper] + " ") will evaluate to Null when 
> [TitleProper] is Null
> 
> Stephen Bond
> Invercargill, NEW ZEALAND
> 
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com [mailto:accessd- 
> bounces at databaseadvisors.com] On Behalf Of Kathryn Bassett
> Sent: Tuesday, 25 February 2014 6:31 p.m.
> To: Stephen
> Subject: [AccessD] Save a concatenate to another field
> 
> On this page:
> http://www.techonthenet.com/access/functions/string/concat.php
> I followed the example at the bottom, and have
> 
> Expr1: [TitleProper]& " " &[SecondaryTitle] & " " & [SubTitle]
> 
> But how do I get the results into the new field I have called Title? 
> (So I can dump TitleProper, SecondaryTitle, and SubTitle)
> 
> 
> --
> Kathryn Rhinehart Bassett (Pasadena CA) "Genealogy is my bag" "GH is 
> my soap"
> kathryn at bassett.net
> http://bassett.net 



More information about the AccessD mailing list