Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: A certainl part of an if() structure never gets executed. Date: Wed, 12 Jun 2013 14:38:29 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 26 Message-ID: References: <2bc90d3b-09c2-4315-9357-ff7f039465e0@googlegroups.com> NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1371047909 27188 64.122.56.22 (12 Jun 2013 14:38:29 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 12 Jun 2013 14:38:29 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:47807 On 2013-06-12, Tim Roberts wrote: > ???????? ?????? wrote: >> >>[code] >> if not re.search( '=', name ) and not re.search( '=', month ) and not re.search( '=', year ): >> cur.execute( '''SELECT * FROM works WHERE clientsID = (SELECT id FROM clients WHERE name = %s) and MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (name, month, year) ) >> elif not re.search( '=', month ) and not re.search( '=', year ): >> cur.execute( '''SELECT * FROM works WHERE MONTH(lastvisit) = %s and YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', (month, year) ) >> elif not re.search( '=', year ): >> cur.execute( '''SELECT * FROM works WHERE YEAR(lastvisit) = %s ORDER BY lastvisit ASC''', year ) > > There is so much you didn't tell us here, including which database you are > using. Are you guys _still_ on Nikos hook? [No, I don't really think he's trolling, but it would be really impressive if he were.] Anyway, I salute your patience. -- Grant Edwards grant.b.edwards Yow! ... I'm IMAGINING a at sensuous GIRAFFE, CAVORTING gmail.com in the BACK ROOM of a KOSHER DELI --