A part of numbers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
My table has field named CodeID that has 11 numbers. Ex: 10002562787.


In a query I want to pull just the last 7 digits of the field and not the
first 4.

Any ideas? What expression I can use in criteria ?

Thanks
chi
 
Thanks for sending me the tips for Access users.

For my question, I tried Right() and I recieved " The expression you entered
has a function containing the wrong number of arguments".

Thanks
Chi
 
Press Ctrl+G to open the Immediate window.
Choose help from the Help menu.
Search for Right()

You will find details of the 2 arguments you need to supply, i.e. the name
of the field to parse, and the number of characters you want.
 
Where did you put this expression?
In report design view, you need a text box in (probably) the Detail section,
and set its ControlSource to:
=Right([CodeID],7)
Make sure the Name of this text box is not CodeID, or the same as any other
field name.

Until you get it sorted out, you could place a CodeID text box alongside it
so that you can make sense of the results.
 
Hi Allen
It works in report! Thank you very much.
----------------------------
In the previous post, I put the expression, Right([CodeID],7) in Query
design view at criteria line and the query showed empty. Sorry, I put it in
query design view, not report design view.

Do you have any ideas why it did not work in query? Please help.
Chi

Allen Browne said:
Where did you put this expression?
In report design view, you need a text box in (probably) the Detail section,
and set its ControlSource to:
=Right([CodeID],7)
Make sure the Name of this text box is not CodeID, or the same as any other
field name.

Until you get it sorted out, you could place a CodeID text box alongside it
so that you can make sense of the results.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

Chi said:
Hi Allen,
I tried Right([CodeID],7) and the report shows empty.
 
Well, if you put it in the *Criteria*, under a field that did not have
exactly those 7 characters, you would get no results returned from your
query.

Perhaps you intended to put it into the Field row in query design, as a
calculated field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chi said:
Hi Allen
It works in report! Thank you very much.
----------------------------
In the previous post, I put the expression, Right([CodeID],7) in Query
design view at criteria line and the query showed empty. Sorry, I put it
in
query design view, not report design view.

Do you have any ideas why it did not work in query? Please help.
Chi

Allen Browne said:
Where did you put this expression?
In report design view, you need a text box in (probably) the Detail
section,
and set its ControlSource to:
=Right([CodeID],7)
Make sure the Name of this text box is not CodeID, or the same as any
other
field name.

Until you get it sorted out, you could place a CodeID text box alongside
it
so that you can make sense of the results.


Chi said:
Hi Allen,
I tried Right([CodeID],7) and the report shows empty.
 
Excellent!
Thank you so much! I got it. I also thanks for your patience.
Chi

Allen Browne said:
Well, if you put it in the *Criteria*, under a field that did not have
exactly those 7 characters, you would get no results returned from your
query.

Perhaps you intended to put it into the Field row in query design, as a
calculated field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Chi said:
Hi Allen
It works in report! Thank you very much.
----------------------------
In the previous post, I put the expression, Right([CodeID],7) in Query
design view at criteria line and the query showed empty. Sorry, I put it
in
query design view, not report design view.

Do you have any ideas why it did not work in query? Please help.
Chi

Allen Browne said:
Where did you put this expression?
In report design view, you need a text box in (probably) the Detail
section,
and set its ControlSource to:
=Right([CodeID],7)
Make sure the Name of this text box is not CodeID, or the same as any
other
field name.

Until you get it sorted out, you could place a CodeID text box alongside
it
so that you can make sense of the results.


Hi Allen,
I tried Right([CodeID],7) and the report shows empty.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Update query trouble 1
Parameter Criteria 3
criteria 7
Criteria for an email address fied 2
Update question 4
Between Date 10
criteria 3
Parameter query 3

Back
Top