Append Query - Data Format

Moxioron

Active Member
Joined
Mar 17, 2008
Messages
436
Office Version
  1. 2019
Hello all.

I am running an append query taking a field from Table 'A' that has an account number, which is 15 digits and all text and appending it to Table 'B', which is formatted for a number, long integer, standard, 0 decimals.

However, I get a message that not all of the records were appended and most of the accounts are not in the formatted table (Table 'B').

I have never done an append query, so please excuse my ignorance.

What am I missing? Thanks for your help.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
A long integer can hold a max positive vaule of 2,147,483,647 (10 digits max).

A 15 digit string of numbers can't be appended a long integer field unless the string is within the range 000000000000000 to 000002147483647.

In a test copy of the database try manually enter on of the 15 digit string that will not appens to see if you can enter it. My guess is that you can't. You will probably need to change the data type to double.
 
Upvote 0
Thanks. I changed it to double/standard/0 decimal and it works great.

However, now I have a field that is text in Table 'A' and Date/Time in Table 'B'. For some reason I still get the message that '23 field(s) to Null due to type conversion failure'

The funny thing is that 23 fields are already blank in the text file. If I select, 'Yes' everything gets brought over. But I obviously would rather not have the error message at all.

Ideas? Thank you for your help.
 
Upvote 0
Few things com to mind:

1) is the field is always blank then do not include it in your append query

2) If it can have data then you need to make sure that the data you are append matched the Date/Time data type

A date/time data type is a numeric data. You can Appen in Null, zero (0), or a vaild date time serial number. But not a zero length string.

If it does have data, what is the format?
 
Upvote 0
Thanks for the response.

It's a text field in the first table and the field is blank at times, but most of the time there is data.

The second table I have the field formatted as Date/Time, Format = Short Date, Required = No, and Indexed = Yes (Duplicates OK)
 
Upvote 0
A simple solution would be to use two separate append queries.

1) Select all the records where the date field in blank and append the other fields except eh blank date field.

2) Select all records with the date field in not blank and append all fields.
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top