A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

return record if 5th character is a letter



 
 
Thread Tools Display Modes
  #1  
Old May 17th, 2010, 08:36 PM posted to microsoft.public.access.queries
Ron5440
external usenet poster
 
Posts: 6
Default return record if 5th character is a letter

Hi,
I have the mid statement to pull the 5th character, but I need the
(query) syntax to filter out the ones that are a letter (alpha)
--
Thanks,
Ron
  #2  
Old May 17th, 2010, 10:02 PM posted to microsoft.public.access.queries
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default return record if 5th character is a letter

UCase(Mid(MyString, 5, 1) = "A" AND UCase(Mid(MyString, 5, 1) = "Z"

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Ron5440" wrote in message
news
Hi,
I have the mid statement to pull the 5th character, but I need the
(query) syntax to filter out the ones that are a letter (alpha)
--
Thanks,
Ron



  #3  
Old May 17th, 2010, 10:14 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default return record if 5th character is a letter

On Mon, 17 May 2010 12:36:01 -0700, Ron5440
wrote:

Hi,
I have the mid statement to pull the 5th character, but I need the
(query) syntax to filter out the ones that are a letter (alpha)


You don't actually need a MID at all: a criteron of

LIKE "????[a-z]*"

on the text field itself will work.

If you do use Mid, you can use

LIKE "[a-z]"

as a criterion on the extracted single character.
--

John W. Vinson [MVP]
  #4  
Old May 17th, 2010, 10:27 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default return record if 5th character is a letter

Like "????[a-z]*"
or
Mid(SomeField,5,1) Like "[a-z]"

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Ron5440 wrote:
Hi,
I have the mid statement to pull the 5th character, but I need the
(query) syntax to filter out the ones that are a letter (alpha)

  #5  
Old May 21st, 2010, 08:15 PM posted to microsoft.public.access.queries
Ron5440
external usenet poster
 
Posts: 6
Default return record if 5th character is a letter

Thanks guys...all answers worked.
--
Thanks,
Ron


"John W. Vinson" wrote:

On Mon, 17 May 2010 12:36:01 -0700, Ron5440
wrote:

Hi,
I have the mid statement to pull the 5th character, but I need the
(query) syntax to filter out the ones that are a letter (alpha)


You don't actually need a MID at all: a criteron of

LIKE "????[a-z]*"

on the text field itself will work.

If you do use Mid, you can use

LIKE "[a-z]"

as a criterion on the extracted single character.
--

John W. Vinson [MVP]
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.