Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Like in a SQL Passthru Query
Message
From
18/04/2011 20:45:46
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01507766
Message ID:
01507772
Views:
46
>Try
>
>
>lc_sealnumber = ALLTRIM(thisform.lc_sealnumber)
>
>lc_sqlstring = "SELECT * FROM view_depositactivity WHERE postingdate BETWEEN ?ld_startdate AND ?ld_enddate "
>lc_sqlstring = lc_sqlstring + " AND sealnumber LIKE '%' + ?lc_sealnumber +'%'"
>= sqlprepare(gnconnhandle, lc_sqlstring, "curactivity")
>IF oApp.gf_sqlexec(gnconnhandle)
> 
>  SELECT curactivity
>  GO TOP
>  BROWSE
>
>ENDIF 
>
>
>
To be more precise and to avoid errors I recommend to make sure that the variable is declared private and not local:
PRIVATE pc_sealnumber
pc_sealnumber = ALLTRIM(thisform.lc_sealnumber)

lc_sqlstring = "SELECT * FROM view_depositactivity WHERE postingdate BETWEEN ?ld_startdate AND ?ld_enddate "
lc_sqlstring = lc_sqlstring + " AND sealnumber LIKE '%' + ?pc_sealnumber +'%'"
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform