Create a new table and set the fields type

M

mattia

Hi, I need to create a table B based on a table A and set two new fields.
The new table field shall have Numeric and Yes/No as data type.

Here is the query I use:
SELECT Prodotti.IDProdotto, Prodotti.DescrizioneProdotto, Prodotti.[PN
(Part Number) XBIT], Prodotti.[PN (Part Number) Produttore],
Prodotti.Valore, 1 AS Quantità, False AS Scelto INTO ProdottiTemp
FROM Prodotti;

Access sets Quantità and Scelta as Numeric values, but I have to ensure
that the new second field (Scelta) is Yes/No in order to provide in a
Mask a simple ListBox with Yes/No as possible values.

Thanks, Mattia
 
K

KARL DEWEY

Access sets Quantità and Scelta as Numeric values
Did you open the table in design view and check the properties?

You know that a Yes/No field stores data as -1 (minus one) and 0 (zero).
 
M

mattia

Il Wed, 22 Jul 2009 09:32:02 -0700, KARL DEWEY ha scritto:
Did you open the table in design view and check the properties?

You know that a Yes/No field stores data as -1 (minus one) and 0 (zero).

Yes, I know it, but then I want to let the user choose between yes and no
on a listbox, as it would be possible if I could define at the beginning
my data types...
 
J

John Spencer

I think the only good way to do this is to build table b structure before you
try importing into it.

You could build the structure as needed. Once built run two queries in
succession. First query would delete all the records in the table and the
second would append the records.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
M

mattia

Il Wed, 22 Jul 2009 13:45:47 -0400, John Spencer ha scritto:
I think the only good way to do this is to build table b structure
before you try importing into it.

You could build the structure as needed. Once built run two queries in
succession. First query would delete all the records in the table and
the second would append the records.


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
Hi, I need to create a table B based on a table A and set two new
fields. The new table field shall have Numeric and Yes/No as data type.

Here is the query I use:
SELECT Prodotti.IDProdotto, Prodotti.DescrizioneProdotto, Prodotti.[PN
(Part Number) XBIT], Prodotti.[PN (Part Number) Produttore],
Prodotti.Valore, 1 AS Quantità, False AS Scelto INTO ProdottiTemp FROM
Prodotti;

Access sets Quantità and Scelta as Numeric values, but I have to ensure
that the new second field (Scelta) is Yes/No in order to provide in a
Mask a simple ListBox with Yes/No as possible values.

Thanks, Mattia

It works perfectly, thank you.
 

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