Error in union-query

Results 1 to 5 of 5

Thread: Error in union-query

  1. #1
    perra Guest

    Default Error in union-query

    Hello! I got a sql-query which works well, but then when I tried to change it to a union query it doesn&#039t work anymore. The error message is "Can&#039t use Memo or OLE Object field &#039maintext&#039 in the SELECT clause of a union query."<BR><BR>I have written my query like this, and I don&#039t see why it shouldn&#039t work: <BR><BR>SELECT * FROM u10 UNION SELECT * FROM u11 UNION SELECT * FROM u12 UNION SELECT * FROM u13 UNION SELECT * FROM u14 UNION SELECT * FROM u15 UNION SELECT * FROM u16 UNION SELECT * FROM u17 UNION SELECT * FROM u19 UNION SELECT * FROM F13 UNION SELECT * FROM F15;"

  2. #2
    Eddie Campbell Guest

    Default RE: Error in union-query

    Unfortunately, as the error message says, you can&#039t include Memo or OLE fields in a union query. If you don&#039t actualy need them in your recordset, you could get the query to work by explicity listing the non memo/ole fields that you do need rather than using * to retrieve all fields.

  3. #3
    perra Guest

    Default RE: That leaves me with another question....

    OK... Thanks, that was news to me but I think I can do without that field. <BR><BR>Another question: Is it possible to display the name of the table that is selected? So that if I use a union-query, it is shown from which table each recordset comes?

  4. #4
    Eddie Campbell Guest

    Default No problem

    "Select Field1, Field2, &#039Table1&#039 AS TableName From Table1 UNION Select Field1, Field2, &#039Table2&#039 As TableName From Table2"

  5. #5
    perra Guest

    Default Many Thanks! (no text)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts