exporting table

I  have a table with just one column with 3000 rows. I need to export into a 
CSV file so that it looks like this:

data1,data2,data3,data4, etc. 

Is this possible? I've attmpeted using the Export Wizard but can't get it.

Thanks!
0
Utf
6/26/2007 1:42:00 PM
access.queries 6343 articles. 1 followers. Follow

2 Replies
476 Views

Similar Articles

[PageSpeed] 52

brian wrote:

>I  have a table with just one column with 3000 rows. I need to export into a 
>CSV file so that it looks like this:
>
>data1,data2,data3,data4, etc. 


Exporting rows means you will get lines in the text file, so
you need to export a single row with all the values.  This
can be done using a function like
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Generic%20Function%20To%20Concatenate%20Child%20Records'
that concatenates all the rows.  If you create a table with
one row, you can export a query like:
SELECT ConCatenate("SELECT yourfield FROM yourtable", ",")
FROM onerowtable

A completely different approach would be to use Access' file
I/O statements to create the file.  This air code outline
provides the general idea:

fnum = FreeFile()
Open "filepath" For Output As fnum
set rs = db.OpenRecordset("yourtable")
Do Until rs.EOF
	Print rs!yourfield;
	rs.MoveNext
Loop
Close fnum

-- 
Marsh
MVP [MS Access]
0
Marshall
6/26/2007 4:48:25 PM
Thank you kindly. That function worked like a charm. 

"Marshall Barton" wrote:

> brian wrote:
> 
> >I  have a table with just one column with 3000 rows. I need to export into a 
> >CSV file so that it looks like this:
> >
> >data1,data2,data3,data4, etc. 
> 
> 
> Exporting rows means you will get lines in the text file, so
> you need to export a single row with all the values.  This
> can be done using a function like
> http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Generic%20Function%20To%20Concatenate%20Child%20Records'
> that concatenates all the rows.  If you create a table with
> one row, you can export a query like:
> SELECT ConCatenate("SELECT yourfield FROM yourtable", ",")
> FROM onerowtable
> 
> A completely different approach would be to use Access' file
> I/O statements to create the file.  This air code outline
> provides the general idea:
> 
> fnum = FreeFile()
> Open "filepath" For Output As fnum
> set rs = db.OpenRecordset("yourtable")
> Do Until rs.EOF
> 	Print rs!yourfield;
> 	rs.MoveNext
> Loop
> Close fnum
> 
> -- 
> Marsh
> MVP [MS Access]
> 
0
Utf
6/26/2007 7:12:02 PM
Reply:

Similar Artilces:

export CRM contacts\mail address's to outlook
Is there a way that anyone knows how to AUTO export and import the contacts from MSCRM, into outlook contacts. either by using windows scheduler or some other means. I have a client that will be using CRM with ExactTarget so having the ability to send mailshots on behalf of others (like outlook). BUT not all of their users have access to CRM, they want to have some scheduler to auto export the crm mail contacts out of CRM and into a public folder contacts list. Anyone got some great ideas? cheers J -- Thanks again for all the help Hi, We are using scrib from scribesoft, who can sche...

setting up tax tables in RMS
I have a client who has special tax needs. $0-$1600 is taxed at 9.25 $1601-$3200 is taxed at 9.75 $3201- and above is taxed at 7% so for example- for a $3,300.00 item- the tax would be $311.00. How would I set this up in RMS? Help! Thanks Andrea Andrea, Create 3 Sales Taxes. Sales Tax 1 Minimum Taxable Amount = None Maximum Taxable Amount = $1,600.99 Tax Rate = %9.25 Sales Tax 2 Minimum Taxable Amount = $1,601.00 Maximum Taxable Amount = $3,200.99 Tax Rate = %9.75 Sales Tax 3 Minimum Taxable Amount = $3,201.00 Maximum Taxable Amount = None Tax Rate = %7 Assign all of these taxes to one...

Adding a calculated ROW to a pivot table
Does anybody know how to add a calculated ROW to a pivot table? I have a pivot table that is returning totals at the bottom, as it should, but I *also* need it to return that total as a percentage of grand total, directly beneath the total. I've always done this free-form in the cells below a pivot table before, but the size of this pivot is dynamic so that's not an option. Also--I'm using the pivot in Access, not Excel directly. Anybody have any tips? Thanks! ...

Pivot Table Splits Columns for same entry #2
Thanks for the response. However, I seem to have misrepresented m problem because the solution doesn't help. In the Layout for the Pivo Table I have the following: In the "ROW": Item#, In the "COLUMN": Tota Lost $, Frequency of Reports generated by item #, In the "DATA": sum th counts of each item #. My chart displays the Item# on the x-axis, th sum the counts of each item # on the y-axis, the Total Lost $ and th Frequency of Reports generated by item # in the legend. There should only be one column per item # whether the chart type i stacked or clustered. I...

Form creates unwanted rows in table
I've created an asset database which keeps track of computers, laptops etc. There is one company which has many departments and every department has many rooms. (surprise, surprise) There are four tables: tables Department and Asset and two "middle" tables DepartmentRoom and AssetRoom. The table structures are as follows: DEPARTMENT id name dep_type dep_num etc... ASSET id name a_type ip_num vendorID serial_num etc... DEPARTMENTROOM id name depID (foreign key to department) ASSETROOM id assetID (foreign key to asset) roomID (foreign key to depa...

html table import
Hi Our sales organization came up with the idea of taking a web based financial tool, write a huge Excel sheet around it, and update the data every week. From it, they get all kinds of stats and results for the management. So far so good. I'm in charge of the web application. Now since a few months, when they import, after exactly 139 lines, the formatting changes in excel. Instead of being right aligned, the table cells are suddenly left aligned (starting on column i), the 0.00 in the source is suddenly shown as such where it was 0 in the 138 lines before. Then after a few hundred...

Need to remove data in table due to input mask; cannot close.
ACCESS Table open, unable to close or modify telephone field. Had tried i/p mask of 0 due to "Unlisted" numbers appearing right-justified when doing a report. I sure thought I changed it back to a NO MASK prior saving the table. Now, table is open and I am unable to do anything with that field, even deleting the content, to satisfy the mask problem. Hands seems to be tied in 'catch 22'; I would have thought (!!??) that the table would not have saved properly if the input mask did not match the field contents. I'm stuck! Thank you so much. =?Utf-8?B?b2ZmZXJvY2t...

Pivot table calculated field: multiply Sum of FieldA with Max of FieldB
Hello usenetters, My question concerns Excel 2003. A user asked me about a calculated field in a pivot table. Some of the fields are DT_NOW, GW_WCR, GW_LOB. The formula of the calculated field should depend on the date (DT_NOW): Up to 30/06/2009: Rotation = GW_WCR / GW_LOB * 91 Starting 01/07/2009: Rotation = GW_WCR / GW_LOB * 28 She added a field to the underlying data called ROT_FACTOR, filled with 91 until 30th june and filled with 28 starting 1st july. The current formula is =IF(ROT_FACTOR>300000;GW_WCR/GW_LOB*91;GW_WCR/GW_LOB*28) The cutoff value 300000 is an arbitrary value base...

Pivot Table Defaults Turn Off Subtotal
Is there a way to change the default behavior of Pivot Tables? Specifically, can I change the default behavior for a Field to NOT show the subtotals? I know how to turn it off easy enough - it's just frustrating doing it over and over. Thoughts? I have not answer, just want to agree that this is a frustrating issue. Ie, everytime I build a Pivot Table, I have to go through the process of manually turning off the subtotals. Another issue I run into is that generally my pivot tables need to have the 'Field Settings' / 'Layout & Print' changed via a manual process ...

DAO and Table Locking
Greetings, I've written some code to create a relationship between table A and table B. The code looks something like this: Set rel = db.CreateRelation("A_B") rel.Table = "A" rel.ForeignTable = "B" Set fld = rel.CreateField("AID") fld.ForeignName = "BID" rel.Fields.Append fld db.Relations.Append rel This code works just fine except that a few lines later, I use DLookup() to find a row in table B, but I then get an error that table B is exclusively locked and cannot be accessed. Can anyone clarify why table B has been...

Table Indexes after upgrade to Dynamics GP v9
After upgrading to Dynamics GP we received an error that was due to "Index 'AK6GL00100' on table 'GMI.dbo.GL00100' does not exist". While troubleshooting this problem I found that there were not any clustered indexes on my GL00100 or GL00105 tables. So, I found the Indexes.cmp in the SQL\Install\0\Company on the server and tried to load the indexes for those tables from that file. That's when I discovered that the indexes in this file were not consistent with our account framework and assumed only 5 segments were in use. Thus, the reason why they failed to loa...

table of numbers 1 thru 52 pre sql2k5
Hi all, What's the easiest way to generate a single column of numbers in a table prior to sql 2k5? thanks, rodchar Check out: http://msdn.microsoft.com/en-us/library/aa175802(SQL.80).aspx -- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS SQL Server MVP Toronto, ON Canada https://mvp.support.microsoft.com/profile/Tom.Moreau "rodchar" <rodchar@discussions.microsoft.com> wrote in message news:C3DD455A-8DC5-42CD-884D-EB67EF6A4B5A@microsoft.com... Hi all, What's the easie...

Cannot export to Excel in Crystal report (cr8)
Hi, I have an application written in vb6 and uses cr8 Crystal report. In the past, the end users were able to export the report to Excel...They have an option of Exporting to Excel 5, 7 and 8. But lately, they were not able to do so, export to Excel will just close the application down without any warning. We all currently have Office 2007 installed, and I am not sure if that is the cause of the issue. But when I export the report from my development machine I have this option to pick "Excel 97-2000" (I don’t' see the "Excel 5, 7, 8" option at all)...

Exporting Ppivot table from Access to Excel
Hi there, (1) I am working with a huge Access database with 346,722 records (2) I created a pivot table in Access and that works (3) Now, I want to export this table to Excel (4) When I try to do this, it says "No Data" and returns a blank Excel page I understand that there is a limitation on the number of lines in Excel (~64K). But, since I have a massive database file, how can I possibly export the Pivot table to Excel? Any comments will be greatly appreciated! Thanks!!! rgds Kaushik You can build a series of queries based of the pivot that break the result down to manageab...

Help with pivot table
Hi, I am looking for a fix in below code, probably addition to it. I'm trying to export a query from ACCESS 2003 to EXCEL 2003. I do that each time with the export to excel button available in access which generates a temp file which I have to save all the time by naming it into appropriate excel file format. So far I have managed to export only the data sheet. I'm stuck with creating the pivot table portion in same code. These few lines I found while browsing and changed them w.r.t. my requirements. I would like to have a pivot table in sheet2 based on data ran...

copy record between tables
Hi, I have two tables with same structure. I need to copy a record from oneto other using vba codes. I'd like avoid to copy field to field.Thank you. Without knowing anything about your table structures, something similar to the following:Dim strSQL As StringstrSQL = "INSERT INTO tblCopy SELECT tblOriginal.* " _ & "FROM tblOriginal WHERE tblOriginal.KeyValue = 4"CurrentProject.Connection.Execute strSQL"Alberto" <saveas[at]iol.it> wrote in message news:uk2oUMBYHHA.3656@TK2MSFTNGP05.phx.gbl...> Hi,> I have two tables with same structure....

SQL statement to find a particular column within all tables
I am looking for a query that will allow me to find all instances of a particular column within all tables so I know where they are all located. Does anyone have such a query they would be willing to share? Thank you. Pam, I posted this query a few months aback on my blog (http://dynamicsgpblogster.blogspot.com/2008/03/in-past-days-i-have-found-lot-of-people.html), but here is the excerpt: select distinct rtrim(objs.name) from syscolumns cols inner join sysobjects objs on (cols.id = objs.id) inner join sysindexes indx on (cols.id = indx.id) where (cols.name = 'ACTINDX') and (ob...

Can Pivot Table layout be copied???
A few weeks ago, I ended up with the perfect Pivot Table layout by dragging fields around -- I just don't remember how I got there! I have attempted to create a similar table (with new data) but, even though the field layout buttons are in the exact same locations, the table looks different. I'm trying to get "Sum of 2004", "Sum of 2005," etc. as column headings across the top instead of having all years one below the other. Is there any way to copy the layout from the "perfect" table to the new one? I answered my own question, with help from De...

Export portfolio view to excel
I am using Money 2004, and I have customized a view that I would like to be able to export to excel. I see how to export reports, but not views, like this portfolio view. Is there a way to do this? I tried moneylink add-on, but it does not provide the info I am after. Thanks! In microsoft.public.money, maydog wrote: >I am using Money 2004, and I have customized a view that I would like to be >able to export to excel. I see how to export reports, but not views, like >this portfolio view. Is there a way to do this? I tried moneylink add-on, but >it does not provide the info I...

sum items in a table based on description
I am interested in summing items is a table based on their description. Is there a formula that will add items together from column based on the contents in another cell reference in the same row? I know a pivot table will do this with some restrictions in the table design. You can use sumif if there is onbly one condition Assume you want to sum values in column C where column B is "x" =SUMIF(B2:B500,"x",C2:C500) Regards, Peo Sjoblom "Hrider" <hrider@yahoo.com> wrote in message news:ejggYE$MFHA.3328@TK2MSFTNGP14.phx.gbl... >I am interested ...

How turn on Classic Pivot Table Settings
How does one turn on Classic Piviot Table Setting from Excel 2007. ...

Exporting Mail box after employee has left company
I'd like to export a mailbox from Exchange 2003. The employee has left the company, and allthough I haven't deleted his user account yet, I would like to know if it is possible to export his account without actually logging in with his username & password and opening outlook as that user. Thanks, Nate Weldon yes; use exmerge.exe to accomplish this... "Nate Weldon" <NateWeldon@discussions.microsoft.com> wrote in message news:674CD1FE-F33E-4734-BC2C-B20210B95A3C@microsoft.com... > I'd like to export a mailbox from Exchange 2003. The employee has left th...

Median in pivot tables
The Excel pivot tables have a variety of functions. The one function that appears to be lacking is median. I'd sure like to be able to determine the median value grouped by some other variable. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.micr...

update data in table for new Format
I have a table with several thousand records. currently i have serial numbers stored as number but i now need to change the format. currently it is 4-8 digits. the new format should be xx-xxxxxx (2 digits a "-" and 6 more digits). I need this new value to store the "-" in the field. I know i can switch the field to a text field and this works but i need a way to convert existing data to the new format. I tried a mask format but it starts at the beinging. so if i put in a ##-###### and my data is 4021 it gives me 40-21 and i need 00-004021. Any ideas on this...

when replicating, I get error message, but there is no table
when replicating with my assistant, I get that there are replication errors, but when I try to open the conflicts table, I get that there are "no conflict tables" =?Utf-8?B?YmttNGVhZ2xl?= <bkm4eagle@discussions.microsoft.com> wrote in news:5246CFE9-3BC1-4411-AB08-3E7B8D67D433@microsoft.com: > when replicating with my assistant, I get that there are > replication errors, but when I try to open the conflicts table, I > get that there are "no conflict tables" You'll have to look at the tables directly. The conflict tables are called BaseTabl...