All,
I'm trying to make the query (below) work in my CR8.0 report (via Database/Show SQL Query). Unfortunately I get the following error message when I preview the report:
"ODBC Error: [Microsoft][ODBC Microsoft Access Driver] The number of columns in the two selected tables or queries of a union query do not match."
If I take out these two statements the query runs fine:
"opr" as type
"olr" as type
I can make this query work in SQL Designer, but the fields come back to the report as memo fields which I cannot use in my case.
Thanks,
Jeff
SELECT
JobTicket."LvYdTime",
JobTicket."ArriveTime",
JobTicket."LvJobTime",
JobTicket."ReturnTime",
Schedule."Sched_ID",
Schedule."PumpReq",
Schedule."PumpSent",
Schedule."Operator",
Schedule."Oiler",
Schedule."JobDate",
"opr" as type
FROM
JobTicket,Schedule
WHERE
JobTicket."JT_ID" = Schedule."Sched_ID"
UNION ALL
SELECT
JobTicket."LvYdTime",
JobTicket."ArriveTime",
JobTicket."LvJobTime",
JobTicket."ReturnTime",
Schedule."Sched_ID",
Schedule."PumpReq",
Schedule."PumpSent",
Schedule."Oiler" as operator,
Schedule."Oiler",
Schedule."JobDate",
"olr" as type
FROM
JobTicket,Schedule
WHERE
JobTicket."JT_ID" = Schedule."Sched_ID" AND Schedule."Oiler"<>' '
I'm trying to make the query (below) work in my CR8.0 report (via Database/Show SQL Query). Unfortunately I get the following error message when I preview the report:
"ODBC Error: [Microsoft][ODBC Microsoft Access Driver] The number of columns in the two selected tables or queries of a union query do not match."
If I take out these two statements the query runs fine:
"opr" as type
"olr" as type
I can make this query work in SQL Designer, but the fields come back to the report as memo fields which I cannot use in my case.
Thanks,
Jeff
SELECT
JobTicket."LvYdTime",
JobTicket."ArriveTime",
JobTicket."LvJobTime",
JobTicket."ReturnTime",
Schedule."Sched_ID",
Schedule."PumpReq",
Schedule."PumpSent",
Schedule."Operator",
Schedule."Oiler",
Schedule."JobDate",
"opr" as type
FROM
JobTicket,Schedule
WHERE
JobTicket."JT_ID" = Schedule."Sched_ID"
UNION ALL
SELECT
JobTicket."LvYdTime",
JobTicket."ArriveTime",
JobTicket."LvJobTime",
JobTicket."ReturnTime",
Schedule."Sched_ID",
Schedule."PumpReq",
Schedule."PumpSent",
Schedule."Oiler" as operator,
Schedule."Oiler",
Schedule."JobDate",
"olr" as type
FROM
JobTicket,Schedule
WHERE
JobTicket."JT_ID" = Schedule."Sched_ID" AND Schedule."Oiler"<>' '