left(string) equivalent
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
<snip sql questions I can't answer>
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.
Uh, keep the quotes. description[:4] is a python expression. <dtml-var "description[:4]"> is shorthand for <dtml-var expr="description[:4]">, whereas <dtml-var description[:4]> is shorthand for <dtml-var name="description[:4]">. Since you have no variable called description[:4], this results in
Error Type: KeyError Error Value: description[:4]
Rik
participants (2)
-
joel grimes -
Rik Hoekstra