With today's example, I'm not really sure today how I should spend these few introduction sentences. I mean, I could demand that we allow the author of this Access inline function only use an Etch-A-Sketch, two plastic cups, and some playdough for all future development. I could console the victim, Jason Law, who actually to deals with the aftermath of this reckless "programmer." Or I could even offer a challenge to see if anyone can actually figure out what this monstrosity does.
Instead though, I'll just humbly point out that I went to the trouble of formatting it (with three failed attempts) for your reading displeasure. Yes, that's right, it was initially a single line of code.
'Formatting added by yours truly. Excuse the lack of "_" characters IIf( Format(Now(),"yyyy") + 0 > Format([sol_date_reqd],"yyyy") + 0 ,-1 ,IIf( Format(Now(),"yyyy") + 0 < Format([sol_date_reqd],"yyyy") + 0 ,IIf( Format([SOL_DATE_REQD],"ww",1,1) + 0 > IIf( Format(Now(),"ww",1,1) + 10 > 52 ,Format(Now(),"ww",1,1) - 42 ,Format(Now(),"ww",1,1) + 10 ) ,IIf( Format(Now(),"ww",1,1) + 10 > 52 ,Format(Now(),"ww",1,1) - 42 ,Format(Now(),"ww",1,1) + 10 ) ,Format([SOL_DATE_REQD],"ww",1,1) + 0 ) ,IIf( Format([sol_date_reqd],"ww",1,1) + 0 < Format(Now(),"ww",1,1) + 0 ,-1 ,IIf( Format([sol_date_reqd],"ww",1,1) + 0 > Format(Now(),"ww",1,1) + 10 ,Format(Now(),"ww",1,1) + 10 ,IIf( Format([sol_date_reqd],"ww",1,1) + 0 > 52 ,1 ,Format([sol_date_reqd],"ww",1,1) + 0 ) ) ) ) )
Aw hell, I just feel too bad not too ... Jason, I'm truly sorry!