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

Soting a Query export

P: n/a
Hi;

How do I get the export to sort its output from a query that has an
order by in the SQL?

SELECT "z[++zp]='" AS z_array, Q.q_serno AS Sern, Source.Src_serno AS
r, Q.q_numb AS num, Qt.dscn, Replace(Replace(Q!q,"'","\'"),Chr$(13) &
Chr$(10),"\n") AS q, IIf(Len(Q!hint)>0,Replace(Q!hint,Chr$(13) &
Chr$(10),"\n"),"") AS h, IIf(Len(Q!ans)>0,Replace(Q!ans,Chr$(13) &
Chr$(10),"\n"),"") AS a, "';" AS term
FROM Source INNER JOIN (Qt INNER JOIN Q ON Qt.qt_serno = Q.q_type) ON
Source.Src_serno = Q.s_serno
ORDER BY 3, 2;

is sorted on the datasheet but not on the export to a text file.

Regards
Ian

Jul 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Odd. Could you give us the steps you're using to do the export?
What version of Access?
I can't get this to not work not matter what I do. As long as the
query is sorted, it's fine. Are you exporting a table that's sorted,
but not a query?

Jul 15 '06 #2

P: n/a
ip*****@pipemedia.co.uk wrote:
Hi;

How do I get the export to sort its output from a query that has an
order by in the SQL?

SELECT "z[++zp]='" AS z_array, Q.q_serno AS Sern, Source.Src_serno AS
r, Q.q_numb AS num, Qt.dscn, Replace(Replace(Q!q,"'","\'"),Chr$(13) &
Chr$(10),"\n") AS q, IIf(Len(Q!hint)>0,Replace(Q!hint,Chr$(13) &
Chr$(10),"\n"),"") AS h, IIf(Len(Q!ans)>0,Replace(Q!ans,Chr$(13) &
Chr$(10),"\n"),"") AS a, "';" AS term
FROM Source INNER JOIN (Qt INNER JOIN Q ON Qt.qt_serno = Q.q_type) ON
Source.Src_serno = Q.s_serno
ORDER BY 3, 2;

is sorted on the datasheet but not on the export to a text file.

Regards
Ian
You are using z[++zp] from with Access/VBA/Jet? Could you explain?

Jul 15 '06 #3

P: n/a
Hi;

The sort seems to be working now.
Being a MS Access dumbo, it was probably something I was/not doing.
You are using z[++zp] from with Access/VBA/Jet? Could you explain?
I am creating a javascript fragment of the Access query for use in my
web page(s)
See http://webhost5.pipemedia.net/ianpel...ts/try_01.html

I do not know enough to get Access to produce the whole damn .js file,
but thats for tomorrow.

Regards
Ian

Jul 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.