Make table query: [Enter 1] AS Test


M

mcrimmins55

I have a make table query. I am querying an existing table, not making a brand new one.

In my new table, I want a few fields from the existing table and new field that is not in the existing table. My new field is called "Test." I want this field to show the value 1 for all records in the table I am making.

Right now, the user running the query must enter the number 1. Here's how that part of the query looks:

[Enter 1] AS Test

I would prefer that the query just assign the number 1 to the TEST field without any user input at all. Maybe someone can help?

Thanks,
Mike
 
Ad

Advertisements

J

John W. Vinson

I have a make table query. I am querying an existing table, not making a brand new one.

This makes no sense.

A MakeTable query makes a brand new table. That's what it does; that's ALL it
does. If you don't want to make a brand new one, you don't want a MakeTable
query; you just want a Select query.

MakeTable queries are VERY rarely actually necessary, and they're very
inefficient, bloat your database, and don't give you much that you can't do
with an appropriate SELECT query - are you sure you need a MakeTable?
In my new table, I want a few fields from the existing table and new field that is not in the existing table. My new field is called "Test." I want this field to show the value 1 for all records in the table I am making.

Right now, the user running the query must enter the number 1. Here's how that part of the query looks:

[Enter 1] AS Test

SELECT [thisfield], [thatfield], 1 As Test
FROM sourcetable;

If it gives you trouble just use parentheses:

(1) As Test
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

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