Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / July 2006

Tip: Looking for answers? Try searching our database.

How do I split field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lucien - 21 Jul 2006 21:37 GMT
I have a field that contains a Qty and unit:

311 ea
12 ea
5 ea
...etc.

How can I return only the number and exclude the "ea".  This field is
currently a text field and I have more than 3 milion records.  
Can I split this field into 2 or at least just return the number in a query?
Klatuu - 21 Jul 2006 22:12 GMT
In most inventory database applications, the unit and quantity are two
different fields.  The best approach would be your first, which would be to
split it into two fields.

I think your problem may be that since you have 3 million records, you might
be bumping up against the access size limit of 2GB.  This means it  would be
best if you can do it with a couple of update queries. Other than that, the
process is pretty straight forward.

First you would need to modify your table design to create the new field.  I
would make the new field numeric to hold the quantity because the existing
field is text.

Then in the update query, you could update the new Qty field to:

Val([OldField)

To use your example: 311 ea would return 311
The old field will still contain 311 ea
The new field will now be a numeric 311

Then run a second query that would take the quantity off and leave only the
unit.  This formula assumes there will always be a space between the number
and the unit.
Here is a formula for the update value:
right(trim(x),len(trim(x))-instr(trim(x)," "))
the original field will now contain
ea

> I have a field that contains a Qty and unit:
>
[quoted text clipped - 6 lines]
> currently a text field and I have more than 3 milion records.  
> Can I split this field into 2 or at least just return the number in a query?
Lucien - 21 Jul 2006 23:00 GMT
Great information!  

Thanks for the help, it worked perfectly.

> In most inventory database applications, the unit and quantity are two
> different fields.  The best approach would be your first, which would be to
[quoted text clipped - 35 lines]
> > currently a text field and I have more than 3 milion records.  
> > Can I split this field into 2 or at least just return the number in a query?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.