select SUM(fuel_bus) from fuel between date="2011-03-12" and date="2011-0
3-15" where busno=2;//
Above mentioned is query for which i am getting mysql syntax error
fuel_bus=column name that stores float fuel qty values(say 18.6)
date=column name, that specifies date on which fuel entry is done
busno=busno for which date wise fuel qty. is feeded
NOw what i want is to calculate fuel qty. from desired date to desired date with respect to specific busno.
select busno,SUM(fuel_bus) from fuel where busno=2;,this query is running,how to integrate between clause with it...
Try to google up MySQL between syntax. One of the top links leads to MySQL documentation with all proper details of its use. To help you get faster on track: the BETWEEN keyword is part of an expression which must go into the WHERE clause and can be combined with other conditions using usual boolean operators, such as AND and OR.