<div dir="ltr">Hola a todos actualizo como segui con esto, en otro fore alguien me ayudo tambien con el siguiente codigo que comparto<div>-------------------------------------------------</div><div><ol style="color:rgb(0,0,0);font-family:monospace;font-size:12px;white-space:pre-wrap"><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">DELIMITER <span style="color:rgb(102,204,102)">//</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">DROP</span> <span style="color:rgb(153,51,51);font-weight:bold">FUNCTION</span> <span style="color:rgb(153,51,51);font-weight:bold">IF</span> <span style="color:rgb(153,51,51);font-weight:bold">EXISTS</span> juevesPasado;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">CREATE</span> <span style="color:rgb(153,51,51);font-weight:bold">FUNCTION</span> juevesPasado<span style="color:rgb(102,204,102)">(</span><span style="color:rgb(102,204,102)">)</span> <span style="color:rgb(153,51,51);font-weight:bold">RETURNS</span> <span style="color:rgb(153,51,51);font-weight:bold">DATE</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">BEGIN</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  <span style="color:rgb(153,51,51);font-weight:bold">DECLARE</span> fecha <span style="color:rgb(153,51,51);font-weight:bold">DATE</span> <span style="color:rgb(153,51,51);font-weight:bold">DEFAULT</span> <span style="color:rgb(153,51,51);font-weight:bold">CURRENT_DATE</span><span style="color:rgb(102,204,102)">(</span><span style="color:rgb(102,204,102)">)</span>;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  WHILE DAYNAME<span style="color:rgb(102,204,102)">(</span>fecha<span style="color:rgb(102,204,102)">)</span> <span style="color:rgb(102,204,102)"><></span> <span style="color:rgb(255,0,0)">'Thursday'</span> DO</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">    <span style="color:rgb(153,51,51);font-weight:bold">SET</span> fecha <span style="color:rgb(102,204,102)">=</span> DATE_SUB<span style="color:rgb(102,204,102)">(</span>fecha<span style="color:rgb(102,204,102)">,</span> <span style="color:rgb(153,51,51);font-weight:bold">INTERVAL</span> <span style="color:rgb(204,102,204)">1</span> <span style="color:rgb(153,51,51);font-weight:bold">DAY</span><span style="color:rgb(102,204,102)">)</span>;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  <span style="color:rgb(153,51,51);font-weight:bold">END</span> WHILE;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  <span style="color:rgb(153,51,51);font-weight:bold">RETURN</span> fecha;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">END</span> <span style="color:rgb(102,204,102)">//</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">DELIMITER ;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"> </div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">DELIMITER <span style="color:rgb(102,204,102)">//</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">DROP</span> <span style="color:rgb(153,51,51);font-weight:bold">FUNCTION</span> <span style="color:rgb(153,51,51);font-weight:bold">IF</span> <span style="color:rgb(153,51,51);font-weight:bold">EXISTS</span> juevesProximo;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">CREATE</span> <span style="color:rgb(153,51,51);font-weight:bold">FUNCTION</span> juevesProximo<span style="color:rgb(102,204,102)">(</span><span style="color:rgb(102,204,102)">)</span> <span style="color:rgb(153,51,51);font-weight:bold">RETURNS</span> <span style="color:rgb(153,51,51);font-weight:bold">DATE</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">BEGIN</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  <span style="color:rgb(153,51,51);font-weight:bold">DECLARE</span> fecha <span style="color:rgb(153,51,51);font-weight:bold">DATE</span> <span style="color:rgb(153,51,51);font-weight:bold">DEFAULT</span> <span style="color:rgb(153,51,51);font-weight:bold">CURRENT_DATE</span><span style="color:rgb(102,204,102)">(</span><span style="color:rgb(102,204,102)">)</span>;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  WHILE DAYNAME<span style="color:rgb(102,204,102)">(</span>fecha<span style="color:rgb(102,204,102)">)</span> <span style="color:rgb(102,204,102)"><></span> <span style="color:rgb(255,0,0)">'Thursday'</span> DO</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">    <span style="color:rgb(153,51,51);font-weight:bold">SET</span> fecha <span style="color:rgb(102,204,102)">=</span> DATE_ADD<span style="color:rgb(102,204,102)">(</span>fecha<span style="color:rgb(102,204,102)">,</span> <span style="color:rgb(153,51,51);font-weight:bold">INTERVAL</span> <span style="color:rgb(204,102,204)">1</span> <span style="color:rgb(153,51,51);font-weight:bold">DAY</span><span style="color:rgb(102,204,102)">)</span>;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  <span style="color:rgb(153,51,51);font-weight:bold">END</span> WHILE;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">  <span style="color:rgb(153,51,51);font-weight:bold">RETURN</span> fecha;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">END</span> <span style="color:rgb(102,204,102)">//</span></div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top">DELIMITER ;</div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"> </div></li><li style="vertical-align:top"><div style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:1em;line-height:1.2em;margin:0px;padding:0px;background:none;vertical-align:top"><span style="color:rgb(153,51,51);font-weight:bold">SELECT</span> <span style="color:rgb(102,204,102)">*</span> <span style="color:rgb(153,51,51);font-weight:bold">FROM</span> datos <span style="color:rgb(153,51,51);font-weight:bold">WHERE</span> fecha <span style="color:rgb(153,51,51);font-weight:bold">BETWEEN</span> juevesPasado<span style="color:rgb(102,204,102)">(</span><span style="color:rgb(102,204,102)">)</span> <span style="color:rgb(153,51,51);font-weight:bold">AND</span> juevesProximo<span style="color:rgb(102,204,102)">(</span><span style="color:rgb(102,204,102)">)</span>;</div></li></ol><font color="#000000" face="monospace"><span style="font-size:12px;white-space:pre-wrap">-------------------------------</span></font></div><div><font color="#000000" face="monospace"><span style="font-size:12px;white-space:pre-wrap">yo lo probe y no pude hacerlo funcionar, si tome su logica y lo aplique desde PHP asi que les dejo lo que le comente al usuario que me ayudo en el foro y el codigo PHP que utilice.</span></font></div><div><font color="#000000" face="monospace"><span style="font-size:12px;white-space:pre-wrap">------------------------------</span></font></div><div><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">Hola EdePCal final no he podido lograr hacerlo desde mysql (si tome la logica que planteaste y lo realice desde php) </span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">Todos los ";" (salvo del del DELIMITER) me daban error - "caracter inesperado"</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">Al quitarlos, CREATE me da el siguiente mensaje de error - "se econtro una nueva declaracion, pero no hay delimitado entre este y el anterior."</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">AL incorporar un DELIMITER para separar DROP de CREATE  y ejecutar la consulta</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">"#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHILE DAYNAME(fecha) <> 'Thursday' DO</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">    SET fecha = DATE_SUB(fecha, INTERVAL ' at line 4"</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">Probe borrando DROP y el error 1064 se repite. </span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">voy a leer más en el manual porque esta claro que algo se me escapa.</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">-----------------------------------------------------------------------------</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">PHP</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">$juevesPasado = date('Y-m-d');</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        $dia_fecha = date('l');</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        while ($dia_fecha != 'Thursday') {</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            //si hoy no es jueves le resto un día a la fecha</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesPasado = strtotime('-1 day', strtotime($juevesPasado));</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesPasado = date('Y-m-d', $juevesPasado);</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            //resto un día al dia de la semana </span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $dia_fecha = strtotime('-1 day', strtotime($juevesPasado));</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $dia_fecha = date('l', $juevesPasado);</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        }</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        </span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        $juevesProximo = date('Y-m-d');</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        $dia_fecha_futuro = date('l');</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        while ($dia_fecha_futuro != 'Thursday') {</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            //si hoy no es jueves le sumo un día a la fecha</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesProximo = strtotime('+1 day', strtotime($juevesProximo));</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesProximo = date('Y-m-d', $juevesProximo);</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            //sumo un día al dia de la semana </span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $dia_fecha_futuro = strtotime('+1 day', strtotime($juevesProximo));</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $dia_fecha_futuro = date('l', $juevesProximo);</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        }</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        //si hoy es jueves - $juevesPasado = hoy y $juevesProximo = hoy + 7 dias</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        if ($dia_fecha == 'Thursday') {</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesPasado = date('Y-m-d');</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesProximo = strtotime('+7 day', strtotime($juevesProximo));</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">            $juevesProximo = date('Y-m-d', $juevesProximo);</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">        }</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">//consulta mysql</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">$vencimiento_semanal = "SELECT SUM(MONTO) AS vencimiento_semana FROM cheques WHERE FECHA_COBRO BETWEEN '$juevesPasado' AND '$juevesProximo' AND ID_ESTADO = 1 AND ID_TIPO = 1";</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">fin PHP -------------------------------------------------------</span><br style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)"><span style="color:rgb(0,0,0);font-family:Verdana;font-size:12px;background-color:rgb(147,188,211)">Muchas gracias por la ayuda voy intentar dar con la solucion, me interesa también saber hacerlo desde mysql.</span>  <font color="#000000" face="monospace"><span style="font-size:12px;white-space:pre-wrap"><br></span></font><br>----------------------------------------------------------------------------------</div><div>Steven muchas gracias al igual que Francisco José por su tiempo !<br clear="all"><div><div dir="ltr" class="m_-7315256721853493647gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><img src="https://docs.google.com/uc?export=download&id=0B8WJ2-PdGbwHaTVRNXZub3Z0UVE&revid=0B8WJ2-PdGbwHMmU1WlpWZDdQdDkxbll2bHFFck4raFVjUUpNPQ"><br></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">El mar., 25 sept. 2018 a las 18:26, Davidson, Steven (<<a href="mailto:srd4121@njit.edu" target="_blank">srd4121@njit.edu</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hola Carlos,<br><br>Ante todo, bienvenido a la lista de correo-e.<div><br></div><div>Si sabes las fechas exactas entre ambos jueves, entonces Francisco José te ha dado la respuesta correcta. Sin embargo, si quieres saber los jueves con respecto a la fecha actual, cuando realices la consulta, entonces necesitas construir las cotas inferior y superior para describir el intervalo.</div><div><br></div><div>Puedes usar la función 'CURRENT_DATE()' o 'CURDATE()'; también puedes usar la constante, 'CURRENT_DATE',para conseguir la fecha actual. Puedes usar 'DAYOFWEEK()' para conseguir el día de la semana de la fecha actual como un número, donde 1 representa Domingo y obviamente 7 representaría Sábado. Como Jueves es 5, podemos calcular cuántos días tenemos que restar a la fecha actual para conseguir la fecha del jueves de la semana pasada: -7 + 5 - día. Asimismo, calculamos la fecha del jueves de la siguiente semana: 7 + 5 - día.</div><div><br></div><div>Espero que esto te sirva.</div><div><br>Steven<div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Tue, Sep 25, 2018 at 12:46 PM Carlos Chianalino <<a href="mailto:cchianalino@gmail.com" target="_blank">cchianalino@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hola a todos es mi primer mail en la lista, espero este activa aun.<div>Necesito si alguien puede ayudarme con esto.</div><div>tengo una bd en myslq en una de las tablas registros documentos con campo fecha y necesito hacer una consulta a la tabla con el siguiente formato</div><div><br></div><div>SELECT* FROM documentos WHERE fecha BETWEEN (jueves pasado) AND (jueves proximo).</div><div><br></div><div>desde ya muchas gracias !<br clear="all"></div></div></blockquote><div><br></div></div></div></div></div>
_______________________________________________<br>
Lista de correo Cconclase <a href="mailto:Cconclase@listas.conclase.net" target="_blank">Cconclase@listas.conclase.net</a><br>
<a href="http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net" rel="noreferrer" target="_blank">http://listas.conclase.net/mailman/listinfo/cconclase_listas.conclase.net</a><br>
Bajas: <a href="http://listas.conclase.net/index.php?gid=2&mnu=FAQ" rel="noreferrer" target="_blank">http://listas.conclase.net/index.php?gid=2&mnu=FAQ</a></blockquote></div></div>