When I run this query from the Query analyzer, I get the all rows within those dates where the sealnumber contains 123
>>SELECT FROM view_depositactivity WHERE postingdate BETWEEN '2011-03-01' AND '2011-03-15' and sealnumber LIKE '%123%'
I'm trying to pass the 123 as a ? argument in a SQL passthru query and can't figure out how to do it.
When I just have the dates in the query I get the right answer.
I'm getting no records back when I use the LIKE clause for the sealnumber
The code below is my latest futile attempt
Any suggestions?
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
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.