Compare date in SQL:
AND DATEDIFF(d, @PeriodFrom, tblA.CreatedOn) >= 0 AND DATEDIFF(d, tblA.CreatedOn, @PeriodTo) >= 0
AND DATEDIFF(d, @PeriodFrom, tblA.CreatedOn) >= 0 AND DATEDIFF(d, tblA.CreatedOn, @PeriodTo) >= 0
| Empid | EmpName | EmpDay | empStatus |
| 1 | Bikash | 1 | P |
| 2 | Bikash | 2 | P |
| 3 | Bikash | 3 | P |
| 4 | Bikash | 4 | A |
| 5 | Bikash | 5 | A |
| 6 | Bikash | 6 | P |
| 7 | Bikash | 8 | P |
| 8 | Rama Rao | 1 | P |
| 9 | Rama Rao | 2 | P |
| 10 | Rama Rao | 6 | P |
| 11 | Rama Rao | 3 | P |
| 12 | Rama Rao | 7 | P |
| EMPNAME | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| Bikash | P | P | P | A | A | P | NULL | P | NULL |
| Rama Rao | P | P | P | NULL | NULL | P | P | P | NULL |