On 10/10/16 02:56 PM, Gary Dale wrote:
I have a database with a large enough number of records that I don't want to do this manually. I would like to have query do it instead. Everything I've found through searches seems to want to do it manually by creating a form.

I have a small number of images (5), one of which will be added to the database based on the content of another field.

What I was thinking was something along the lines of (extra fields omitted)

SELECT "place"
  CASE WHEN "place" = 0 THEN 'image0.png'
         WHEN "place" = 1 THEN 'image1.png'
         WHEN "place" = 2 THEN 'image2.png'
         WHEN "place" = 3 THEN 'image3.png'
         WHEN "place" >= 4 THEN 'image4.png'
  END "ribbon"
FROM "Results"

However I have two issues with that. The first is that the "Ribbon" field probably won't contain the image from the current directory but will instead just contain the text. The other is that Base complains about a SQL syntax error when I try to save it.

Can anyone help me move forward on this?


OK, missing comma after the first field explains the syntax error. But as expected, I'm getting the file name rather than the actual file in the query result.

--
To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to