The board has been upgrade to the latest version. Please let me know of any problems.
Also, there is a high probability that the forum will move to a different host, but that will happen in 2018.
Thanks, Doug

adding values to a custom field

Discuss using and your tips/tricks for CATraxx
Post Reply
distero
Posts: 3
Joined: Sun Nov 12, 2017 7:55 pm

adding values to a custom field

Post by distero » Sun Nov 12, 2017 8:01 pm

I would like to add the Album.Title to the Custom Field 01.
How can I do this for all the Albums in the database with one instruction?

User avatar
DougWilliams
Site Admin
Posts: 228
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: adding values to a custom field

Post by DougWilliams » Sun Nov 12, 2017 11:36 pm

You will need to use the utility SQLUpdate: http://www.fnprg.com/index.html

BACKUP YOUR DATABASE BEFORE USING THIS QUERY.

This will update EVERY CUSTOM01 with the Album Title regardless of whether or not there is already data in the field.

Code: Select all

UPDATE Album INNER JOIN AlbumCustom ON Album.AlbumID = AlbumCustom.AlbumID SET AlbumCustom.Custom01 = [album].[Title];
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

distero
Posts: 3
Joined: Sun Nov 12, 2017 7:55 pm

Re: adding values to a custom field

Post by distero » Mon Nov 13, 2017 12:25 am

thank you for the quick respons!
Frederik had send me a solution some 10 years ago, but I've lost it ...
This looks the same it seems to me.

distero
Posts: 3
Joined: Sun Nov 12, 2017 7:55 pm

Re: adding values to a custom field

Post by distero » Tue Nov 14, 2017 10:03 am

can I add some text before and after the [Album][...] fields? how? with "...text..." ?
or even combine sdome existing fields?

User avatar
DougWilliams
Site Admin
Posts: 228
Joined: Thu May 22, 2014 11:36 am
Location: Wisconsin, USA
Contact:

Re: adding values to a custom field

Post by DougWilliams » Tue Nov 14, 2017 11:22 am

Something like
SET AlbumCustom.Custom01 = "The Greatest Album:" +[album].[Title]+" is my favorite" (it might be single quotes instead of the double quotes. I'm not able to test)

Other fields can be done but becomes more complicated if the field is in a different table. If you can provide the field names I can provide some examples.
Record Collector
"You Mean I'm Supposed To Listen To 'Em?!?!?!?"

Post Reply