[Zope-DB] ZSQL - Year, Month, Date issue HELP!

Roderick Silva rodericksilva@msn.com
Thu, 06 Feb 2003 12:25:58 -0500

<html><div style='background-color:'><DIV>
<P><FONT face="Courier New">The attached code&nbsp;will work correctly as long as I don't cross over the year. Once I do that the numbers get all messed up. In other words if I choose 02/31/02 to 03/31/02 I am ok. Once I choose 12/31/02 to 1/31/03 the numbers get messed up.<BR><BR>I was told that I should concat. Can someone point the way? Can someone write one line of it for me? <BR><BR>Once I can start helping out on the list I will. Right now I am not much help unless you need Flash work in return. That I can do well. </FONT></P><FONT face="Courier New"></FONT></DIV>
<DIV><FONT face="Courier New">Thanks,</FONT></DIV>
<DIV><FONT face="Courier New"></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New">-Roderick-</FONT></DIV>
<P>select tblproblemtype.name as Problem_Type, count(*)as total from tblservicerequest, tblproblemtype </P>
<P>where <BR>&nbsp;&nbsp;&nbsp; year(timelogged) = &lt;dtml-var "REQUEST.form['subfield_startdate_year']"&gt;&nbsp; and &lt;dtml-var "REQUEST.form['subfield_enddate_year']"&gt; <BR>and <BR>&nbsp;&nbsp;&nbsp; month(timelogged) = &lt;dtml-var "REQUEST.form['subfield_startdate_month']"&gt;&nbsp; and &lt;dtml-var "REQUEST.form['subfield_enddate_month']"&gt; <BR>and <BR>&nbsp;&nbsp;&nbsp; day(timelogged) between &lt;dtml-var "REQUEST.form['subfield_startdate_day']"&gt;&nbsp; and &lt;dtml-var "REQUEST.form['subfield_enddate_day']"&gt; <BR>and <BR>&nbsp;&nbsp;&nbsp; tblservicerequest.problemtype = tblproblemtype.id</P>
<P>group by tblproblemtype.name<BR>order by tblproblemtype.name;<BR></P>
<DIV></DIV></div><br clear=all><hr>STOP MORE SPAM with <a href="http://g.msn.com/8HMPENUS/2728">the new MSN 8</a> and get 2 months FREE*</html>