I want to add a SQL condition in my existing query, to return NULL if the below condition is reached.
I have 2 columns SHIFTA_START and SHIFTA_END.
- [SHIFTA_START] = employee's clock in time
- [SHIFTA_END] = employee's clock out time
Example:
- SHIFTA_START: 3/10/2016 12:15:00 PM
- SHIFTA_END: 3/10/2016 12:30:00 AM
Hence I want to condition
IF DATEPART SHIFTA_START = DATEPART SHIFTA_END
AND SHIFTA_START > SHIFTA_END
THEN return NULL
How do I make code this in SQL? Help is appreciated, thank You so much! ^_^