dbTalk Databases Forums  

"Like" comparison question

comp.databases.ms-access comp.databases.ms-access


Discuss "Like" comparison question in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Marshall Barton
 
Posts: n/a

Default Re: "Like" comparison question - 07-21-2010 , 09:41 PM






David Kaye wrote:

Quote:
Marshall Barton <marshbarton (AT) wowway (DOT) com> wrote:

Sometimes, but not always. IsNumeric will return True for
anything that can represent a number, even somewhat obscure
number styles such as:
+1.234E-3
-1.234D+3
$12.34-
$(12.34)
which makes IsNumeric useless in most situations where you
might expect it to work.

I think this is an unnecessary worry. No account number is going to have
those characters.
How about:
12345D6
543E21

The original question was to see if it was all digits
optionally followed by a letter. Clearly IsNumeric does not
detect some failures to meet the requirement.

--
Marsh

Reply With Quote
  #12  
Old   
David Kaye
 
Posts: n/a

Default Re: "Like" comparison question - 07-22-2010 , 12:43 AM






Marshall Barton <marshbarton (AT) wowway (DOT) com> wrote:

Quote:
How about:
12345D6
543E21

The original question was to see if it was all digits
optionally followed by a letter. Clearly IsNumeric does not
detect some failures to meet the requirement.
Dang! Absolutely right. Okay, I'll stick to the solution I posted.

Reply With Quote
  #13  
Old   
Jon Lewis
 
Posts: n/a

Default Re: "Like" comparison question - 07-22-2010 , 03:31 AM



"David Kaye" <sfdavidkaye2 (AT) yahoo (DOT) com> wrote

Quote:
sfdavidkaye2 (AT) yahoo (DOT) com (David Kaye) wrote:

Slight correction. Note the 0 to 9 addition:

select case right$(str$,1)
case "A" to "Z", "a" to "z", "0" to "9"
if maybeok then
isokay=true
else
isokay=false
end if
case else
isokay=false
end select



Reply With Quote
  #14  
Old   
Jon Lewis
 
Posts: n/a

Default Re: "Like" comparison question - 07-22-2010 , 03:35 AM



Thanks to all who replied. It's got to be any number of digits 0-9 (no
other characters) optionally follwed by a single letter (a-z) so my original
way seems as good as any.

Jon

"David Kaye" <sfdavidkaye2 (AT) yahoo (DOT) com> wrote

Quote:
sfdavidkaye2 (AT) yahoo (DOT) com (David Kaye) wrote:

Slight correction. Note the 0 to 9 addition:

select case right$(str$,1)
case "A" to "Z", "a" to "z", "0" to "9"
if maybeok then
isokay=true
else
isokay=false
end if
case else
isokay=false
end select



Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.