Place Holder in a Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What do you put in the field when you want to create a place holder for a
column, so that if you export to an excel file it only adds the columns you
need from the query?
 
hi,

You can add a column to the query retrieving all results from the table you
want to export to Excel, and put any value you wish into rows for this new
column. The rows only with a specific value or range of values would be
exported.

Hope this helps.
 
Hi,

But I am thinking I don't want the header to show in the excel file, that
column is blank and already has it's own header. So, I thought the
placeholder i.e. the "new column" had to have an expression or something so
that it would not overwrite the column in the spreadsheet?
 
Hi,

Umm..you don't have to export the new column... For example,

SELECT test.city, test.num
FROM test
WHERE (((test.num3) Is Not Null))
GROUP BY test.city, test.num;

In this query, columns [city] and [num] are retrieved by the query (and
possibly exported to excel). Note that there is a where clause for the
[num3] column, which determines which records to select/export. Since [num3]
is only in the WHERE clause, it will factor into the results but not
retrieved/visible/exported.

Hope this helps,
geebee
 
Add to the SELECT satatement like this --
SELECT test.city, test.num, "XX" as [My New Column1], 0 as [My New Column2],
Null as [My New Column3]



geebee said:
Hi,

Umm..you don't have to export the new column... For example,

SELECT test.city, test.num
FROM test
WHERE (((test.num3) Is Not Null))
GROUP BY test.city, test.num;

In this query, columns [city] and [num] are retrieved by the query (and
possibly exported to excel). Note that there is a where clause for the
[num3] column, which determines which records to select/export. Since [num3]
is only in the WHERE clause, it will factor into the results but not
retrieved/visible/exported.

Hope this helps,
geebee


T Miller said:
Hi,

But I am thinking I don't want the header to show in the excel file, that
column is blank and already has it's own header. So, I thought the
placeholder i.e. the "new column" had to have an expression or something so
that it would not overwrite the column in the spreadsheet?
 
Back
Top