Date: prev next · Thread: first prev next last
2016 Archives by date, by thread · List index


On 11/10/16 02:05 AM, Robert Großkopf wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Gary,

Go it. The old primary key problem. Base insists that it create one
and call it ID instead of using another name.

How do you create tables? Every name for a field with primary-key is
allowed. Primary-key has only to be unique.

Your query (by adding the comma) could also work, if the images are in
the same path as the *.odb-file.

In the form you have to connect the imagecontrol to the field, which
shows the text. The imagecontrol will show the iage insted of the path.

Yes, found the way to make something a Primary Key.

I got the code to work but am trying to optimize it (for human readability more than speed). I wanted something like this:

SELECT "event_name", "first_name", "middle_initial", "last_name", "sex", "age", "email", "place",
 CASE
   WHEN "age" BETWEEN 0 AND 18  THEN 'Youth'
   WHEN "age" BETWEEN 19 AND 59 THEN 'Adult'
   ELSE 'Senior'
 END "Group",
 CASE
WHEN "place" <= 3 THEN ( SELECT "finish", "ribbon" FROM "Ribbons" WHERE "ID" = "place" ) WHEN "place" >= 4 THEN ( SELECT "finish", "ribbon" FROM "Ribbons" WHERE "ID" = "4" )
 END "Finish", "Ribbon"
FROM "Results"

which Base accepts as syntactically valid but generates a "Column not found: 4 in statement [...] when I run the query. Looking at the code in Design View, it has the Ribbon field as a Field instead of as an Alias with the code generating the field.

Is it possible to specify two fields in one CASE statement or do I have to duplicate the code for each field?



--
To unsubscribe e-mail to: users+unsubscribe@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

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.