Need help in Shell Script comparing todays date with Yesterday date from Sysdate

Hi,

I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing.

The above requirement i want in Shell script(KSH)...
Can any one please help me?