473,387 Members | 1,536 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,387 software developers and data experts.

Exporting excel file from Access, how to add additional columns?

167 100+
I am using a query to select my columns from a table and then I am using the export function to export the results to an excel spreadsheet. I need to add to blank columns to the end, "Verified Year" and "Verified By". These columns are not on the table. I know I can manually add them to the excel spreadsheet but I am creating an automated process using vba code to create & export this so there will not be any manual intervention. Therefore, when the query is executed (select colA, colB, colC from table), I need to have this select statement somehow create these 2 additional columns.
Any suggestions?

Thanks!
Aug 24 '10 #1

✓ answered by NeoPa

Try using :
Expand|Select|Wrap|Line Numbers
  1. SELECT mytable.colA
  2.      , mytable.colB
  3.      , mytable.colC
  4.      , Null AS Add_Column1

5 2811
NeoPa
32,556 Expert Mod 16PB
I would have thought creating empty columns in your query with the names to match the columns you want should work fine for you.
Aug 24 '10 #2
ncsthbell
167 100+
I have tried "select mytable.colA, mytable.colB, mytable.colC, "add_column1"
from mytable;

This give me the header 'Expr1007' and populates each row with the data value "add_column1". What I need is the column header to be "add_column1" and the data rows should be empty.

I have tried several different ways to do this and have not been succesful.

Thanks
Aug 24 '10 #3
NeoPa
32,556 Expert Mod 16PB
Try using :
Expand|Select|Wrap|Line Numbers
  1. SELECT mytable.colA
  2.      , mytable.colB
  3.      , mytable.colC
  4.      , Null AS Add_Column1
Aug 24 '10 #4
ncsthbell
167 100+
That worked! Thanks. Some times I tend to over think the simple things! Thanks for your quick response!
Aug 24 '10 #5
NeoPa
32,556 Expert Mod 16PB
No worries. These things are always so much easier when you've done them before many times.
Aug 24 '10 #6

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

Similar topics

5
by: jsudo | last post by:
I have a Access database with a large amount of records (close to 500,000) that I would like to export to Excel. I found out that Excel has the capability of of about 65,000 rows so I know I...
3
by: Lynn A. | last post by:
I have to perform an import from an excel file to Access. The file comes originally as a csv file. I have to delete some rows and columns, then change the formatting of some columns. I am using...
1
by: Geoff Jones | last post by:
Hi I have a question which I hope somebody can answer. I have written a VB application with which I want to import an Excel file, analyze the data within it and do some calculations. There are...
1
by: Moomin Ma | last post by:
I have create a excel file with 2 columns and 2 rows for demonstration. The excel file is then opened by ms access and therefore a mdb file was created. The mdb file showing the correct linkage...
2
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform...
2
by: ruthboaz | last post by:
Hi, I am exporting a table with data to an excel file.. Some fields are empty in the exported file while the others and the key field, has values. The empty field(s) in excel, will be entered...
0
by: FireGeek | last post by:
I need to create a new Access table with columns based on an Excel file. More Information: This task will come before I actually import the Excel file data into my data base. This Excel file...
1
by: BaaZauq | last post by:
Hello everybody! I'm not a master of clientside JavaScript but I have much working knowledge of it. Here is my problem : I have a web-page with a "text-area" box. I have an excel file with 10...
0
by: JFKJr | last post by:
I have an excel file, which has columns C and D grouped together, I am trying to delete blank columns and rows from the excel file, ungroup the columns and import the file to MS Access using Access...
1
by: JFKJr | last post by:
Hi! I have exported an access table data into an excel file using the following code. However, the code exported all the data to the excel sheet starting from 'A' cell (first column). But I want to...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.