itzumar
Posts: 88
|
Posted: 06/01/2013, 11:58 AM |
|
i have table
month amount
april13 500
may13 600
june13 500
now i want sql querry liek that
if i enter may 13, than sql genrate all data of may13 as well as previous
when i enter june13,than sql genrate all data of june13 as well as previous
_________________
Umar |
|
|
solesz
Posts: 137
|
Posted: 06/02/2013, 3:41 AM |
|
O.K. Go for it. :)
Unless you have a question, there are no answers.
http://www.w3schools.com/sql/sql_func_sum.asp http://www.w3schools.com/sql/sql_where.asp
schematically: SELECT SUM(what_I_need) FROM data_source WHERE date =< a_given_date
The exact statement may depends on the SQL database what you use (MySQL, MSSQL, etc)
|
|
|
|