Hey, LZ should strengthen exercise, analyze more, and learn to make inferences.
Birthday is your DateTime field, my example just dealt with the case of strings, you can put two
'20000101' string
Replace with
convert (varchar, Birthday, 112)
Convert the date to a string with convert and then process
I did n’t look at the specific calculations. I do n’t know if the logic is correct or not. I just converted the datetime type and asked lz to compare it myself.