Hello!

Wonder if my error jumps out at any of you - attempting to get a 3 column
result - would you take a look?

`( SELECT "appointment"."date" AS "Date", "physician"."lastname" AS
"Description", "appointment"."time" AS "Comment" FROM "pat_appt",
"appointment", "physician", "patient" WHERE "pat_appt"."appt_id" =
"appointment"."id" AND "patient"."id" = "pat_appt"."pat_id" ) UNION ( SELECT
"prescription"."next_fill_date" AS "Date", "medicines"."generic" AS
"Description", "pharmacy"."name" AS "Comment" FROM "pat_med",
"prescription", "pharmacy", "medicines", "patient" WHERE
"pat_med"."presc_id" = "prescription"."id" AND "patient"."id" =
"pat_med"."pat_id" AND "medicines"."id" = "prescription"."medication" AND
"pharmacy"."id" = "prescription"."pharm_id" ) UNION ( SELECT "bill"."due" AS
"Date", "bill"."descrip" AS "Description", "bill"."amount" AS "Comment" FROM
"pat_bill", "bill", "patient" WHERE "pat_bill"."bill_id" = "bill"."id" AND
"patient"."id" = "pat_bill"."pat_id" ) UNION ( SELECT "immunizations"."due"
AS "Date", "immunizations"."description" AS "Description",
"immunizations"."date" AS "Comment" FROM "pat_immun", "immunizations",
"patient" WHERE "pat_immun"."imun_id" = "immunizations"."id" AND
"patient"."id" = "pat_immun"."pat_id" ) ORDER BY 1 ASC, 4 ASC, 7 ASC, 10
ASC`

The error is 
SQL Status: HY000
Error code: 1000

syntax error, unexpected $end, expecting BETWEEN or IN or SQL_TOKEN_LIKE

I'm attaching the relationships.

http://nabble.documentfoundation.org/file/n3695780/08.png 

Any suggestions?

Beth

--
View this message in context: 
http://nabble.documentfoundation.org/UNION-Query-throwing-error-tp3695780p3695780.html
Sent from the Users mailing list archive at Nabble.com.

-- 
For unsubscribe instructions e-mail to: users+h...@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