Can I set destination field data types in an Access update query?

J

John Spencer

Since the field types are already defined in an UPDATE query, the answer
is no. An update query updates existing fields in existing records.

Do you perhaps mean in a MakeTable query? If so, you do have some
control on defining the field types, but it is limited. It involves
using the various cast functions to force the data type. CCur, CLng,
CDbl, CDate, etc. You use an expression for the field like

IIF(True,[TheTable].[TheField],CCUR(0)) as TheField

That will coerce the data type as currency.

A better solution is to define the table and then append records to the
table. If you need to you can delete all the records in the table
before appending new records.





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


Nails wrote:
 

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