473,385 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Soting a Query export

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
3 1807
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: alessia | last post by:
hi, I have a query that visualizes me, according to some criterions from me inserted, name , Surname , Address , phone ok.. Now, through a button, positioned in a Form, I have to only export...
4
by: Nicolae Fieraru | last post by:
Hi All, I have an access query which retrieves some record. I can export the results of it as an excel document, using the function TransferText. What I actually need is to export the query as a...
3
by: azzi2000 | last post by:
This should be rather simple. I have a query using different link tables and 2 parameters. The query works perfect. However I need to export or save the result in an Access table in order to...
5
by: Simon | last post by:
Dear reader, With the export command you can export a query to Excel. By activate this command a form pop's up with the following text:
1
by: CoolFactor | last post by:
MY CODE IS NEAR THE BOTTOM I want to export this Access query into Excel using a command button on an Access form in the following way I describe below. Below you will find the simple query I am...
3
by: Wayne | last post by:
I'm trying to automate the export of a query to a text file using code. If I export the query manually I get the exact result that I want i.e. If I select the query then choose File/Export from...
1
by: rhbourne | last post by:
Hello, I'm doing something wrong here, and it's driving me nuts. A very strange thing is happening with a query that populates an XML export function. 1. I have a query and its XML export...
17
by: chadh | last post by:
Hello, I'm having some troubles exporting a query to a csv file. I am able to use the doCMD.TransferText to output the query to the csv file, however, I cannot get it to use the Export...
8
by: iheartvba | last post by:
Hi I am using Access 2007 and am trying to export a query to a fixed length text file. I tried using the following code to export the text file: DoCmd.TransferText acExportFixed, , "qryFFRDeFile",...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.