By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,680 Members | 1,475 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,680 IT Pros & Developers. It's quick & easy.

Data type in Union query

P: 7
Hi,

Helped by some genius programmers here on the forum I have used a UNION query to create a report that is ready to be exported to excel.

The problem now is that I have a column "description" that uses a rich text data type so the information is stored in MYSQL with <div> tags etc..

As I set this field to "memo" in the access table, the output is fine when represented in forms or even in queries, but now with the UNION query, all the divs are shown. Thus making it impossible to simply export it to excel.

Questions:
1. Can I define the data type in the Union query?
2. OR, if this is not possible, how could I change the format when exporting to excel?


Many thanks for all the help you could give me,

siech
Nov 3 '07 #1
Share this Question
Share on Google+
2 Replies


Jim Doherty
Expert 100+
P: 897
Hi,

Helped by some genius programmers here on the forum I have used a UNION query to create a report that is ready to be exported to excel.

The problem now is that I have a column "description" that uses a rich text data type so the information is stored in MYSQL with <div> tags etc..

As I set this field to "memo" in the access table, the output is fine when represented in forms or even in queries, but now with the UNION query, all the divs are shown. Thus making it impossible to simply export it to excel.

Questions:
1. Can I define the data type in the Union query?
2. OR, if this is not possible, how could I change the format when exporting to excel?


Many thanks for all the help you could give me,

siech
You could add a column to your query for output purposes and reference your 'offending' column in a function to strip out replace HTML formatting thus returning only the text.

You'd be defining what characters to replace and keep the characters you'd want to retain. When I say 'retain' this actually means the functional 'extra' column in your query could be used for output only whilst your actual data column remains unaffected. The 'data' column still keeps the html formatting stored in your database. (you simply don't show the data column in the output...take the tick off in query design basically)

Have a look at this thread to give you an idea

http://www.thescripts.com/forum/thread451486.html

Jim :)
Nov 3 '07 #2

P: 7
You could add a column to your query for output purposes and reference your 'offending' column in a function to strip out replace HTML formatting thus returning only the text.

You'd be defining what characters to replace and keep the characters you'd want to retain. When I say 'retain' this actually means the functional 'extra' column in your query could be used for output only whilst your actual data column remains unaffected. The 'data' column still keeps the html formatting stored in your database. (you simply don't show the data column in the output...take the tick off in query design basically)

Have a look at this thread to give you an idea

http://www.thescripts.com/forum/thread451486.html

Jim :)
Thanks for the info Jim. If it's so complicated I think I will just drop the rich text functionality :)

siech
Nov 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.