first: link two tables in a select query, use "id" as a link.
second:collect "time" of table a, and use "month" to change your time record into month number. eg: Month(time)
third:collect "Part" or whatever you want to show in your result as "数量".
fourth: use "group" function to "time", and "count" function to "Part", you'll get what you want.
Can't type chinese, if you don't get it, leave a msg, I'll explain you in chinese after work.
Hope it can help you!