dbTalk Databases Forums  

Codebase Expressions RIGHT() TRIM()

comp.databases.xbase.codebase comp.databases.xbase.codebase


Discuss Codebase Expressions RIGHT() TRIM() in the comp.databases.xbase.codebase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ryan
 
Posts: n/a

Default Codebase Expressions RIGHT() TRIM() - 08-13-2003 , 02:27 PM






I am attempting a query in codebase to query for a string that "Ends
In" a user specified string. i.e. 'Dilbert' would end in "ert"

Part of the expression that I am using is this(Assume NAME is an r4str
field):
UPPER(RIGHT(TRIM(NAME),3)) = 'ERT'

In this example '3' could really be any number and 'ert' could really
be any text. The above expression however is unable to find
"Dilbert". If the expression is changed to

UPPER(RIGHT(TRIM(NAME),7)) = 'DILBERT'

then everything is fine and 'Dilbert' is found. I can also do the
following

UPPER(RIGHT(NAME,3)) = ' '

and all entries in the name table are found as they should be (since
NAME is padded with spaces at the end).

Why won't UPPER(RIGHT(TRIM(NAME),3)) = 'ERT' work?

I am using Codebase 6.5 for Windows CE. Thank you.

Reply With Quote
  #2  
Old   
PPL
 
Posts: n/a

Default Re: Codebase Expressions RIGHT() TRIM() - 08-13-2003 , 02:53 PM






Well, it sure works in dBase IV...
I see no problem with the syntax...

PPL
"Ryan" avait écrit le 13/08/2003 :
Quote:
I am attempting a query in codebase to query for a string that "Ends
In" a user specified string. i.e. 'Dilbert' would end in "ert"

Part of the expression that I am using is this(Assume NAME is an r4str
field):
UPPER(RIGHT(TRIM(NAME),3)) = 'ERT'

In this example '3' could really be any number and 'ert' could really
be any text. The above expression however is unable to find
"Dilbert". If the expression is changed to

UPPER(RIGHT(TRIM(NAME),7)) = 'DILBERT'

then everything is fine and 'Dilbert' is found. I can also do the
following

UPPER(RIGHT(NAME,3)) = ' '

and all entries in the name table are found as they should be (since
NAME is padded with spaces at the end).

Why won't UPPER(RIGHT(TRIM(NAME),3)) = 'ERT' work?

I am using Codebase 6.5 for Windows CE. Thank you.

--
PPL
(pour m'écrire, éliminez le _no_spam_ de mon adresse)



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 - 2013, Jelsoft Enterprises Ltd.