[Zope] left(string) equivalent

joel grimes joelgrimes@hotmail.com
Thu, 15 Jun 2000 19:34:01 PDT


I should have given a little more detail.

I have an odbc connection and a zsqlmethod that work fine when the 
zsqlmethod says:

select description, datein
from san_jose

But I just want the first 4 characters of the description field.  So I've 
tried:

select substring(description, 1, 4), datein
from san_jose

I've also tried substr(), and some variations.  I even tried the Access 
version - left(description, 4).

If it can't be done in the query, and I have to get the whole string in the 
sql method and slice it later, I can live with that, but then I have another 
problem: I let the wizard create a report for me and it gave me results that 
include:

<tr>
  <td><dtml-var description null=""></td>
  <td><dtml-var datein null=""></td>
</tr>

works fine.

so I changed "description" to "description[:4]" (no quotes, though).  If I 
try to view the report I get an error.

Error Type: KeyError
Error Value: description[:4]

Any ideas?

Thanks
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com