Here’s is a quick method of getting the quarter from a date. For example
| Month | Quarter |
| 1 – January | 1 |
| 2 – February | 1 |
| 3 – March | 1 |
| 4 – April | 2 |
| 5 – May | 2 |
| 6 – June | 2 |
| 7 – July | 3 |
| 8 – August | 3 |
| 9 – September | 3 |
| 10 – October | 4 |
| 11 – November | 4 |
| 12 – December | 4 |
DateTime date = Convert.ToDate("5/10/2010");
decimal YearlyQuarter = Math.Ceiling(((decimal)date.Month / 12) * 4);
The above code will give a value of 2 to the YearlyQuarter variable because May is in the 2nd quarter of a year.