By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,705 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,705 IT Pros & Developers. It's quick & easy.

Query and pulling out certain parts of a field

P: n/a
I have a text field that I am using in a query. It looks like this
"123456".
What I want to do is pull out the "1" "2" "3" "4" "5" "6" separately
and put it in a report. I can pull out the following text in my query
using the following statement "P: Left([sidstrPHYS_PRFL_SERIAL],1)."
This will produce my "1" that I am looking for. I can also pull out
the "6" using the following statement "S:
Right([sidstrPHYS_PRFL_SERIAL],1)". Now my question for the access
gods is what is the statement to pull out the second, third, fourth,
fifth character out by itself?
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Scott wrote:
I have a text field that I am using in a query. It looks like this
"123456".
What I want to do is pull out the "1" "2" "3" "4" "5" "6" separately
and put it in a report. I can pull out the following text in my query
using the following statement "P: Left([sidstrPHYS_PRFL_SERIAL],1)."
This will produce my "1" that I am looking for. I can also pull out
the "6" using the following statement "S:
Right([sidstrPHYS_PRFL_SERIAL],1)". Now my question for the access
gods is what is the statement to pull out the second, third, fourth,
fifth character out by itself?


Use Mid.
Mid(field,positioninstring,1)

Nov 13 '05 #2

P: n/a
Max
Ever use F1 Help? Highly recommended if you search on related
function such as left and right you can click on see also which will
bring up Mid function

Make sure you have your Visual Basic Language Reference Help installed
Goto Functions section look for left or right function then click on
see also you will also see Mid as a related function

This works for most of the functions you know

Use MID function

MID(text,start_num,num_chars)

Syntax

MID(text,start_num,num_chars)

Text is the text string from which you want to extract the
characters.

Start_num is the position of the first character you want to
extract. The first character in Text is 1.

Num_chars specifies how many characters to return from Text.

ss************@yahoo.com (Scott) wrote in message news:<e7*************************@posting.google.c om>...
I have a text field that I am using in a query. It looks like this
"123456".
What I want to do is pull out the "1" "2" "3" "4" "5" "6" separately
and put it in a report. I can pull out the following text in my query
using the following statement "P: Left([sidstrPHYS_PRFL_SERIAL],1)."
This will produce my "1" that I am looking for. I can also pull out
the "6" using the following statement "S:
Right([sidstrPHYS_PRFL_SERIAL],1)". Now my question for the access
gods is what is the statement to pull out the second, third, fourth,
fifth character out by itself?

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.