Hi All,
I want to develop a sql query based on following table, where I record life insurance policy payment receipt dates against policy numbers as below table. ( Each policy has 12 payment entries)
Policy_Number | Receipted_Date |
352 | 2012-02-21 |
352 | 2012-03-21 |
352 | 2012-04-21 |
352 | NULL |
352 | NULL |
352 | NULL |
352 | NULL |
352 | NULL |
352 | NULL |
352 | NULL |
352 | NULL |
352 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
410 | NULL |
I need to run a query against above table to see how many payments received against each policy. ( Payment received means ‘Receipted_Date’ IS NOT NULL )
Appreciate if someone can help with a suitable query which would display output as below.
Policy_Number | Receipted_Date |
352 | 3 |
410 | 0 |
Thanks
Mira