[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 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> </DIV>
<DIV><FONT face="Courier New">-Roderick-</FONT></DIV>
<P><BR><BR>----------------------------------------------------------------------</P>
<P>select tblproblemtype.name as Problem_Type, count(*)as total from tblservicerequest, tblproblemtype </P>
<P>where <BR> year(timelogged) = <dtml-var "REQUEST.form['subfield_startdate_year']"> and <dtml-var "REQUEST.form['subfield_enddate_year']"> <BR>and <BR> month(timelogged) = <dtml-var "REQUEST.form['subfield_startdate_month']"> and <dtml-var "REQUEST.form['subfield_enddate_month']"> <BR>and <BR> day(timelogged) between <dtml-var "REQUEST.form['subfield_startdate_day']"> and <dtml-var "REQUEST.form['subfield_enddate_day']"> <BR>and <BR> 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>