473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

parsing a long ID into separate fields

11
I am attempting to separate a unique ID into separate fields (columns) using the Right/Left command. I am able to do this when I specify to use the rightmost or leftmost characters but am getting an error message when I specify to take the 2 characters starting from the third character in. Here is an example of my unique ID: 2011_1_HeronSS_3

Using Right([unique_ID],1) returns "3". That is what I want.
However,
Using Right([unique_ID],3,2)gives me an error message "The expression you entered has a function containing the wrong number of arguments" instead of the "SS" that I need.

I have used the example from the Access manual to base my formula off of and have formatted it EXACTLY how the example is in the book. Why is Access seeing this simple command as wrong? Thanks for any help/suggestions!!
Jan 14 '13 #1
3 1183
Seth Schrock
2,965 Expert 2GB
You need the Mid() function to grab a portion of a string from the middle of another string. So it would be:
Expand|Select|Wrap|Line Numbers
  1. Mid(unique_ID,11,2)
You might have to edit the numbers if I mis-counted, but that should be easy. Here are some links for the Left(), Right(), and Mid() functions:
Left Function
Right Function
Mid Function
Jan 14 '13 #2
Rabbit
12,516 Expert Mod 8TB
If the left part of the string can be variable length, use a Right() and then a Left().
Jan 14 '13 #3
NeoPa
32,556 Expert Mod 16PB
AnneRB:
I have used the example from the Access manual to base my formula off of and have formatted it EXACTLY how the example is in the book
I suggest you check the manual again closely Anne. The parameters you list are certainly valid looking for the Mid() function, but both the Left() and Right() functions take only two parameters. If the manual actually has an example of using three parameters with either the Left() or Right() functions, then it is simply wrong.

To find the best (most appropriate) way to handle extracting data from your long string ID field would certainly require a clearer understanding of exactly how it's constructed. If all the sections are always exactly the same length then it's more straightforward. If not, then Rabbit's suggestion of using Left() or Right() embedded within the other is likely to be necessary. Even that may not be reliable enough. Only a full understanding will determine this.
Jan 15 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: NotGiven | last post by:
Say you want to display and search "services offered". There are a finite number of services offered. You want to be able to search the database for each service offered separately. Given the...
1
by: entfred | last post by:
I have a select box in html that looks like this: <select name="communities" size="25" onChange="form1.submit()"> <option value="0043 George Train &nbsp;">0043 George Train...
2
by: Radu | last post by:
Hi. I got a "|" delimited file, and one of its columns (the last one) is MANY chars long. If I use my try to manually import the file, the text in the last column is cut off at char 255, as it...
7
by: Tzanko | last post by:
As we all know, there is a 8060 bytes size limit on SQL Server rows. I have a table which requires a number of text fields (5 or 6). Each of these text fields should support a max of 4000...
3
by: ferdib | last post by:
Hello, I have a table with one field 'NAME', consisting of the firstname and surname of a person. I want to split the content of the 'NAME' field into 2 new fields 'FIRSTNAME' and 'SURNAME'....
5
by: bbasberg | last post by:
Hello, I want to separate three different groups of fields from one record. Originally I was going to add a button on a form to "drill-down" to more detail is the user wanted to see it. I...
3
by: jayo17 | last post by:
Hi All (Access 2003/XP) I have an Excel file with name information in the form of LastName, First Name in one field. I want to have the name separated into 2 fields, LastName and First...
1
by: Gerardo Herzig | last post by:
Hi all. Im trying to develop yet another email filter. Just for fun for now. Im having a little trouble parsing long 'To' and 'Cc' headers. Sometimes p.e. the 'To' header comes like ...
1
MindBender77
by: MindBender77 | last post by:
Hello Again All, I have a memo field that is backslash delimited. I am attempting to break up this field into individual fields. Ex (memo field). \John L. Doe\\StreetName RD\\City, Pa 11111 ...
2
by: Marsha McCarthy | last post by:
Hi, I have have an access database for my accounts receivable. I have a table named "Invoice Table" with the Invoice Data some of the key fields are Invoice Reference Number (auto number from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.