Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALLTRIM in a sql expression of cursoradapter
Message
 
 
To
28/03/2010 10:28:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01457654
Message ID:
01457662
Views:
36
>>>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.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform