Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALLTRIM in a sql expression of cursoradapter
Message
From
28/03/2010 10:37:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01457654
Message ID:
01457663
Views:
25
>>>>Thank
>>>>
>>>>
>>>>I try with a UDF function but Error
>>>>
>>>>
>>>>      PRIVATE ab
>>>>      Ab = CREATEOBJECT("cruflaaa.CRUFLaaa")
>>>>WAIT WINDOW  Ab.cAlltrimAmline( "    testg                     ")  Good result
>>>>
>>>>
>>>>      TEXT TO .SELECTCMD NOSHOW TEXTMERGE PRETEXT 15
>>>>			SELECT HDBK, Hid , HDOCNO, HAMOUNT,  STR( HDOCDATE ) AS 'DATEDOC',CREATEDBY,
>>>>			STR(Createdon) AS 'createdon' , hremint  FROM <<.TABLES>>
>>>>			WHERE Ab.cAlltrimAmline( HDBK ) LIKE '<<Vp_in>>'
>>>>      ENDTEXT
>>>>
>>>>
>>>>But here function Ab.cAlltrimAmline NOT defined !
>>>
>>>Why do you need to use UDF at all? If you want to get rid of spaces, use
>>>
>>>      TEXT TO .SELECTCMD NOSHOW TEXTMERGE PRETEXT 15
>>>			SELECT HDBK, Hid , HDOCNO, HAMOUNT,  STR( HDOCDATE ) AS 'DATEDOC',CREATEDBY,
>>>			STR(Createdon) AS 'createdon' , hremint  FROM <<.TABLES>>
>>>			WHERE RTRIM(LTRIM( HDBK )) LIKE '<<Vp_in>>'
>>>    ENDTEXT
>>>
>>>Also, are you sure that it's valid to use STR function with dates?
>>
>>or
>>
>>>      TEXT TO .SELECTCMD NOSHOW TEXTMERGE PRETEXT 15
>>>			SELECT HDBK, Hid , HDOCNO, HAMOUNT,  STR( HDOCDATE ) AS 'DATEDOC',CREATEDBY,
>>>			STR(Createdon) AS 'createdon' , hremint  FROM <<.TABLES>>
>>>			WHERE HDBK  LIKE '%<<Vp_in>>%'
>>>    ENDTEXT
>
>I'm assuming that '%' is included into Vp_in already, because otherwise I don't see a reason for using LIKE and not = at all.

In that case, there's no need to trim, is there ?
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform