left(string, n) equivalent (newbie q.)
Pardon my ignorance, I'm coming from a VB/Access background. I need to find an equivalent to using left(string, 4) in a zope SQL method's select query. My SQL book says I can use SUBSTRING(string, 1, 4) in a query but no luck. I'm connecting to an Access database. btw - this mail list ROCKS! I've never waited more than 10 minutes for a response. Thanks ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
You should be able to use python's slice like so: <dtml-if "word[:4] == 'help'" > ... where "word" is the variable you want to use only 4 characters of. Hope this helps, bye. ----- Original Message ----- From: joel grimes <joelgrimes@hotmail.com> To: <zope@zope.org> Sent: Thursday, June 15, 2000 3:18 PM Subject: [Zope] left(string, n) equivalent (newbie q.)
Pardon my ignorance, I'm coming from a VB/Access background.
I need to find an equivalent to using left(string, 4) in a zope SQL method's select query. My SQL book says I can use SUBSTRING(string, 1, 4) in a query but no luck. I'm connecting to an Access database.
btw - this mail list ROCKS! I've never waited more than 10 minutes for a response.
Thanks ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 In article <000901bfd712$42628800$ec0000c0@pollak.com>, Luis Cortes <lcortes@pollak.com> writes
You should be able to use python's slice like so:
<dtml-if "word[:4] == 'help'" > ...
where "word" is the variable you want to use only 4 characters of.
Hope this helps,
But he is referring to a zsqlmethod, and you should be able to pass sql thru. Perhaps if he posts the zslqmethod.. Maybe it's an Access thing. - -- Regards, Graham Chiu gchiu<at>compkarori.co.nz http://www.compkarori.co.nz/index.php Powered by Interbase and Zope -----BEGIN PGP SIGNATURE----- Version: PGPsdk version 1.7.1 iQA/AwUBOUjGTrTRdIWzaLpMEQL1IACgp1lkupw3pCyxkAbVJ6melhuv2/8AoJ78 U//cKJwG0QQsCwyWWHIM/LbL =e+7V -----END PGP SIGNATURE-----
participants (3)
-
Graham Chiu -
joel grimes -
Luis Cortes