Inserting blank columns into query

S

Scott

Hello,

I am formatting data that will be imported into another softward package so
I need my query to appear in a specific format with five columns.
Specifically, I need my query to have five fields (or columns) but I only
have three columns of data.

I need my query to look as follows:
Field 1: Data
Field 2: Blank
Field 3: Blank
Field 4: Data
Field 5: Data

Question:
How do I insert blank columns into my query? Within design view, I have
inserted blank columns but every time I run my query, Access removes my blank
columns and I end up with three contiguous fields with data.

Thanks for your help.

Scott
 
B

Bob Barrows [MVP]

Scott said:
Hello,

I am formatting data that will be imported into another softward
package so I need my query to appear in a specific format with five
columns. Specifically, I need my query to have five fields (or
columns) but I only have three columns of data.

I need my query to look as follows:
Field 1: Data
Field 2: Blank
Field 3: Blank
Field 4: Data
Field 5: Data

Question:
How do I insert blank columns into my query? Within design view, I
have inserted blank columns but every time I run my query, Access
removes my blank columns and I end up with three contiguous fields
with data.

Thanks for your help.

Scott

Select Field1,"" As Field2, ...
or
Select Field1,Null As Field2, ...

Which one you choose depends on te other software package's ability to
handle nulls.
 
J

John Spencer

In the query grid (design view).

In the blank column, type NULL into the field "cell" and then check the Show
checkbox for that column.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 
B

Bob Barrows [MVP]

Oops - I keep forgetting that people might not be familiar with SQL View ...

In the query grid, I would probably do either this:

Field2: ""
or
Field2: Null

and, as John says, click the Show checkbox.
 
J

John Spencer

Yeah, it is tough to know what level of experience the poster has. I often
guess wrong, but I attempt to err on the side of lower level of experience,
especially when the poster does not post the SQL statement that they are using
or attempting to use.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top