P
Pradeep
Hello,
I have created a crosstab query with the following structure:
A --> Datatype is Text
B --> Datatype is Text
C --> Datatype is Text (this is the column heading and it has values like
111-
111,122-122,144-144...so on)
D --> Sum(Sal) --> Named as Total.
The cross tab shows up perfectly in the order expected as follows:
A B 111-111 122-122 144-144 Total
a b 1000 2000 3000 6000 (Sum of the values in the row)
c d 1000 1000 1000 3000
When i right click on the query and export into excel, it comes out
perfectly with the Total column at the end.
But when i create a recordset (DAO.Recordset Or Just Recordset) out of the
crosstab and do a CopyFromRecordset into Excel the order of columns is
disturbed and Total column comes right after column B as shown below:
A B Total 111-111 122-122 144-144
a b 6000 1000 2000 3000
c d 3000 1000 1000 1000
I am not sure as to why this happens. Any thougths/ideas on how to fix it
will be highly appreciated. I need to do a CopyFromRecordset and then format
the data and cannot do a DoCmd.Outputto (which is giving the data in right
order).
Thanks in advance.
Pradeep
I have created a crosstab query with the following structure:
A --> Datatype is Text
B --> Datatype is Text
C --> Datatype is Text (this is the column heading and it has values like
111-
111,122-122,144-144...so on)
D --> Sum(Sal) --> Named as Total.
The cross tab shows up perfectly in the order expected as follows:
A B 111-111 122-122 144-144 Total
a b 1000 2000 3000 6000 (Sum of the values in the row)
c d 1000 1000 1000 3000
When i right click on the query and export into excel, it comes out
perfectly with the Total column at the end.
But when i create a recordset (DAO.Recordset Or Just Recordset) out of the
crosstab and do a CopyFromRecordset into Excel the order of columns is
disturbed and Total column comes right after column B as shown below:
A B Total 111-111 122-122 144-144
a b 6000 1000 2000 3000
c d 3000 1000 1000 1000
I am not sure as to why this happens. Any thougths/ideas on how to fix it
will be highly appreciated. I need to do a CopyFromRecordset and then format
the data and cannot do a DoCmd.Outputto (which is giving the data in right
order).
Thanks in advance.
Pradeep