Paramater Criteria

G

Guest

I need a criteria to run a query to pick up the last four number of seven
digit number. Is it possable to use a parameter such as Between [Enter
Begin Sequece] And [Enter End sequence] Or Like "*" with an additional
criteria to just pick up the last four numbers?
 
S

Steve

Put the following expression in a blank field in your query:
LastFourNumber = Right([NameOfSevenDigitField],4)

This field will contain the last four digits of all your numbers.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Thanks Steve. I really need to capture a sequence from a begining to an
ending sequence number. For example....find records of the last numbers from
1001 through 1020. Cant a prompt be done to ask begin then an end sequence
only retreiving the last four numbers between begining sequence and ending?

Steve said:
Put the following expression in a blank field in your query:
LastFourNumber = Right([NameOfSevenDigitField],4)

This field will contain the last four digits of all your numbers.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)




acss said:
I need a criteria to run a query to pick up the last four number of seven
digit number. Is it possable to use a parameter such as Between [Enter
Begin Sequece] And [Enter End sequence] Or Like "*" with an additional
criteria to just pick up the last four numbers?
 
J

John W. Vinson

Thanks Steve. I really need to capture a sequence from a begining to an
ending sequence number. For example....find records of the last numbers from
1001 through 1020. Cant a prompt be done to ask begin then an end sequence
only retreiving the last four numbers between begining sequence and ending?

Sure. Just use Steve's calculated field suggestion; in a vacant Field cell put

LastNum: Right([fieldname], 4)

Then on the criteria line under this field put

BETWEEN 1001 AND 1020

or

BETWEEN [Enter start of sequence:] AND [Enter end of sequence:]

or even

BETWEEN [Forms]![frmCrit]![txtStart] AND [Forms]![frmCrit]![txtEnd]

to pull the criteria from unbound textboxes on a form.

John W. Vinson [MVP]
 

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

Top