Getting the sum from database | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Getting the sum from database

The database has a field that stores a date value and another that stores an integer. I need the sql statement to retrieve the sum of the integer column whose month in the date is a specified month. I use access as the database.

6th May 2019, 7:39 PM
Sachith Gunasekara
Sachith Gunasekara - avatar
2 Answers
0
select sum(the_integer_field) from your_table where month(the_date_field) = your_value
6th May 2019, 9:01 PM
Andri Hry
Andri Hry - avatar
0
you can’t use functions after the where clause right??
8th May 2019, 12:32 PM
Sachith Gunasekara
Sachith Gunasekara - avatar