Make Table vs Copy Table

  • Thread starter Thread starter Meilu
  • Start date Start date
M

Meilu

Hello

I am trying to make a temporary copy of a table to
manipulate. So I used a make table query to copy table A
into TempTable.

The problem is... the Date field in the original table is
being saved as type text instead of date.

Is this going ot be a problem? Because I need to make
comparisons by date. And if this is going ot be a
problem, any idea on how to solve it?

thanks in advance,
Meilu
 
If you are going to use the temp table repeatedly, it is probably better to
use an Append query rather than a Make table query. That way you can
guarantee the data types are right. To delete the previous records before
the append:
db.Execute "DELETE FROM MyTable;", dbFailOnError

The data types for MakeTable queries are likely to be wrong when:
- the source is a calculated field (in a query), or an undefined field (e.g.
an attached text file), or
- the first few rows are all Null in that field.
The visual clue that the data type is not understood is that your date (or
number) field is being left-aligned like text.

If the source is a calculated date field, try wrapping the expression in
CVDate(), e.g.:
CVDate([MyDate] + 30)
This often helps Access understand the intended data type.
 
Back
Top