Left three 8's

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

Guest

I have a column of numbers, formatted as numbers. These numbers begin with
anywhere from zero to seven 8's. I want to create a query that pulls from
this column only the records that begin with three 8's.
 
I have a column of numbers, formatted as numbers. These numbers begin with
anywhere from zero to seven 8's. I want to create a query that pulls from
this column only the records that begin with three 8's.

Select YourTable.* from YourTable where
Left([YourTable].[NumberField],3) = 888;
 
Thank you, but that seems to be pulling all fields with three or more 8's at
the beginning. Assuming my table is called Eights, I added all the fields,
which consist of only two fields...one called "Name" and one called "Number."
I typed:
Left([Eights].[Number],3) = 888. Was this correct? (I'm not good at
Access, as you can see.)

fredg said:
I have a column of numbers, formatted as numbers. These numbers begin with
anywhere from zero to seven 8's. I want to create a query that pulls from
this column only the records that begin with three 8's.

Select YourTable.* from YourTable where
Left([YourTable].[NumberField],3) = 888;
 
Change to this:

Select YourTable.* from YourTable where
Left([YourTable].[NumberField],3) = 888
And Mid([YourTable].[NumberField],4,1) <> 8;

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



Jean said:
Thank you, but that seems to be pulling all fields with three or more 8's at
the beginning. Assuming my table is called Eights, I added all the fields,
which consist of only two fields...one called "Name" and one called "Number."
I typed:
Left([Eights].[Number],3) = 888. Was this correct? (I'm not good at
Access, as you can see.)

fredg said:
I have a column of numbers, formatted as numbers. These numbers begin with
anywhere from zero to seven 8's. I want to create a query that pulls from
this column only the records that begin with three 8's.

Select YourTable.* from YourTable where
Left([YourTable].[NumberField],3) = 888;
 
Thanks so much!!!

PC Datasheet said:
Change to this:

Select YourTable.* from YourTable where
Left([YourTable].[NumberField],3) = 888
And Mid([YourTable].[NumberField],4,1) <> 8;

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com



Jean said:
Thank you, but that seems to be pulling all fields with three or more 8's at
the beginning. Assuming my table is called Eights, I added all the fields,
which consist of only two fields...one called "Name" and one called "Number."
I typed:
Left([Eights].[Number],3) = 888. Was this correct? (I'm not good at
Access, as you can see.)

fredg said:
On Tue, 19 Oct 2004 11:27:01 -0700, Jean wrote:

I have a column of numbers, formatted as numbers. These numbers begin with
anywhere from zero to seven 8's. I want to create a query that pulls from
this column only the records that begin with three 8's.

Select YourTable.* from YourTable where
Left([YourTable].[NumberField],3) = 888;
 
Back
Top