• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use where with between clause

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Description:
fuel_bus=column name that stores float fuel qty values(say 18.6)
fuel=DB name
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...
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic