the code from the last 700 is this
private string strsqlcommandBeta =
"select top 700 * from objectaer " +
" order by objectdate desc";
and the code for the first 10 words of the memo field called patronvalue17 should be this.
private string strsqlcommandBeta = "select LEFT(patronvalue17, INSTR(10, patronvalue17, " ") - 1) from objectaer " + " order by objectdate desc" + " ";
I don’t know how to put this together
this code give the next error
select top 700 LEFT(patronvalue17, INSTR(10, patronvalue17, ' ') - 1) * from objectaer
Syntax error (missing operator) in query expression ‘LEFT(patronvalue17, INSTR(10, patronvalue17, ‘ ‘) – 1) *’.
Scott found the syntactic bug. The reason why you’re not getting the 10 words is because that’s not how INSTR works. Its signature is
meaning you’re looking up the first space after character 10 and then getting everything to the left of that. Normally that means you’re getting 2-3 words out, rather than 10.
If you’re getting all the memo text out that sounds very strange to me, but is indicative that InStr fails to match your space character and returns the index of the last character. I’d try supplying a comparetype.
http://www.techonthenet.com/access/functions/string/instr.php