AnsweredAssumed Answered

SQL query finding value between 2 dates

Question asked by jetserkok on Feb 20, 2015
Latest reply on Feb 20, 2015 by philmodjunk

Title

SQL query finding value between 2 dates

Post

Hey all, 

I have a SQL with which i would like to find a summed value between 2 dates. Works perfect without the 'between 2 dates' part. Can somebody help me? 

ExecuteSQL( 
                    "
                    SELECT SUM ( b.\"PrecioTejido_ÓrdenesDeTrabajo\" )
                    FROM \"Join Prendas Trabajadores\" b
                    WHERE b.\"TrabajoID\" = ? 
AND b.\"FechaTerminadoTejido\" BETWEEN DATE( 2008 ; 1 ; 1 ) AND DATE( 2008 ; 1 ; 31 )
                    "
                    ; "" ; "" ; 
                    Join Prendas Trabajadores::TrabajoID
                    )

Just the red part does not seem to work, i get a '?' as a result. 

Outcomes