exporting from access to excel

jbknight

New Member
Joined
Oct 29, 2004
Messages
5
When I export from access to excel I end up with numbers as text, that can easily be converted to a number by highlighting and selecting convert to number. Is there an a way to get the numbers to come over as numeric without having to highlight and convert? This is probably a very easy question, I just can't seem to figure it out.

Thanks,
jbknight
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Say your Access db has a table in it, with a numeric field. You're trying to export that table.

Instead of exporting the table itself, create a query with all the fields you need in it, and then put the numeric field inside the int() function, and then export this query. That should force Excel to pick it up a number.

Hope that helps,
 
Upvote 0
Thanks, Corticus that helps. I have created the query and now use it through a macro that exports it out, but I can't figure out where to put the int() function within the query. Thanks again for your help. jbknight
 
Upvote 0
Using 'MyField' to represent the field you're trying to fix.

Just add a field to the query, like so:
MyFieldFixed: Int(MyField])

You now have a new field, arbitrarily named 'MyField Fixed' that displays the value Int([MyField]).

This should force every record from this field to an integer or null value.

-Cort
 
Upvote 0
I think I am really close.

Here's what it looks like:
RFSTotal-Monday:Select Query
Field:--Last_Name--First_Name--RFS_Number--MON-----aRFS_Number: Int([RFS_Number])
Table:--RFS Detail--RFS Detail---RFS Detail----RFS Detail--Blank
Total:--Group by----Group By----Group By------Sum------Group By

I keep getting a data type mismatch error or a circular error if I take the 'a' out of aRFS_Number. I am trying to get the RFS_Number field to export out as an interger instead of text. I really appreciate your help. Thanks, jbknight
 
Upvote 0
Try this for your query:

SELECT [RFS Detail].LastName, [RFS Detail].FirstName, Sum([RFS Detail].MON) AS SumOfMON, Int([rfs_number]) AS aRFS_Number
FROM [RFS Detail]
GROUP BY [RFS Detail].LastName, [RFS Detail].FirstName, Int([rfs_number]);

Enter this as SQL, it one of the view choices (datasheet/design grid/SQL) for your query.

What type of data is this field 'rfs_number'?

I'm not sure why your getting the data mismatch, but it usually indicates a problem with criteria, or a join, such as trying to join a text field on a number field, or setting the criteria of a text field in a query to a numeric value.

I tested the above SQL with rfs_number as both a number and text, and it worked both ways, so your problem might be elsewhere...
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

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