• Najiib (unregistered)

    Cognos generated SQL? I've seen much worse.

  • (cs)

    Uh... all of the above?

  • Dan (unregistered)

    Oh my god....

    Was it formatted like that in the original application? Or are you obfuscating it to give it more wtf-ery? (or wth-ery or whatever-it-is-we-are-this-werk-ery)

  • (cs)

    DROP DATABASE;

  • (cs)

    Well, C and E for sure. Not so sure of A B and D however.

  • Dmitri (unregistered)

    F. All of the above.

  • [email protected] (unregistered)

    Ouch! Stop the insanity! I think there's actually a hidden message to an alternate life-form buried in there if only this weren't a Wednesday (and a work day to boot)...

  • (cs)

    maybe we should ask SpectateSwamp to find the images embedded inside the script. His birds have a trained eye for that.

  • Dan (unregistered)

    F: Ha ha, fooled you!

    This is actually code that mortgage lenders have been using to decide whether you're sub-prime or not. You feed in the details, and if the answer comes back before the week is out, you get your loan.

  • jamface (unregistered)

    If that was hand-written, the person responsible has failed. At life.

  • konrad (unregistered)

    Great, my lunch just burped back up. This is the sickest thing I've seen all day.

  • s. (unregistered)

    Let me guess. A major part of it is calculating the date of easter, first full moon after equinox and all.

  • RW (unregistered)

    This MUST be the output of a graphical tool - for the sanity of everyone in the entire industry. The alternative does not bear contemplation.

  • The Undroid (unregistered)

    f. commit homicide

  • (cs)

    My god, I just puked on my keyboard.

    Please tell me someone didn't write this by hand.

  • (cs)

    WHERE ARE THE LOLCATS?!

  • Ricky (unregistered)

    g: it's april's fools sequel

  • John Doe (unregistered)

    Table and column names with spaces and dashes. Nice touch :) I love this code!

    Sorry, just noticed that April Fool's day is already behind us. WTF is this code?!

  • (cs)

    I guess it would be a a lot better if it was indented properly.

    (CASE WHEN "Help Desk Attributes".Priority = '3-Medium' AND ("Help Desk Attributes"."TAT To Close - Days" - (Case WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 END)) <= 5 THEN 1

    	WHEN "Help Desk Attributes".Priority = '4-Low' 
    	AND ("Help Desk Attributes"."TAT To Close - Days" - (Case WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 
    	END)) <= 10 THEN 1 ELSE 0 
    

    END)

    Still quite WTF tho ;)

    Addendum (2008-04-02 08:40): I guess it would be a a lot better if it was indented properly.

    (CASE 
    	WHEN "Help Desk Attributes".Priority = '3-Medium' AND 
    		("Help Desk Attributes"."TAT To Close - Days" - 
    			(Case 
    			WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 
    			END)) <= 5 THEN 1 
    			
    		WHEN "Help Desk Attributes".Priority = '4-Low' 
    		AND ("Help Desk Attributes"."TAT To Close - Days" - (Case WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 
    		END)) <= 10 THEN 1 ELSE 0 
    END)
    

    Still quite WTF tho ;)

  • (cs)

    H: This is actually a fragment of SQL code for determining an extremely accurate 5-year projection on Stock Prices.

    Unfortunately, it takes 5 years to run.

  • WC (unregistered) in reply to StarLite

    Somehow, that the reformatting only serves to highlight just how crazy it actually is. Before, it just -seemed- crazy. Now I know it is.

  • (cs) in reply to StarLite
    I guess it would be a a lot better if it was indented properly.
    Not really....
  • Vollhorst (unregistered)

    Reminds me of the only valid way to validate email addresses with regular expressions:

    (?:(?:\r\n)?[ \t])(?:(?:(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t] )+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?: \r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:( ?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t])))@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\0 31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)
    ](?:(?:\r\n)?[ \t])
    )(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+ (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?: (?:\r\n)?[ \t])))|(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z |(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n) ?[ \t]))<(?:(?:\r\n)?[ \t])(?:@(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:
    r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n) ?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t] )))(?:,@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])* )(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t] )+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))) :(?:(?:\r\n)?[ \t]))?(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+ |\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r \n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?: \r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t ]))"(?:(?:\r\n)?[ \t])))@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031 ]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)]( ?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(? :(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(? :\r\n)?[ \t])))>(?:(?:\r\n)?[ \t]))|(?:[^()<>@,;:\".[] \000-\031]+(?:(? :(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)? [ \t]))"(?:(?:\r\n)?[ \t])):(?:(?:\r\n)?[ \t])(?:(?:(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]| \.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<> @,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|" (?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t])))@(?:(?:\r\n)?[ \t] )(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\ ".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(? :[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[ ]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))|(?:[^()<>@,;:\".[] \000- \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|( ?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]))<(?:(?:\r\n)?[ \t])(?:@(?:[^()<>@,; :\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([ ^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\" .[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[
    ]\r\]|\.)](?:(?:\r\n)?[ \t])))(?:,@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".
    [] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]
    r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\] |\.)](?:(?:\r\n)?[ \t])))):(?:(?:\r\n)?[ \t]))?(?:[^()<>@,;:\".[] \0 00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(?:[^"\r\]|\ .|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[^()<>@, ;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[]]))|"(? :[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t])))@(?:(?:\r\n)?[ \t]) (?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\". []]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t])(?:[ ^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[] ]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))>(?:(?:\r\n)?[ \t]))(?:,\s( ?:(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\ ".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]))(?:.(?:( ?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[ ["()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t ])))@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t ])+|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(? :.(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+| \Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))|(?: [^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\".[
    ]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]))<(?:(?:\r\n) ?[ \t])(?:@(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[[" ()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n) ?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<> @,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))(?:,@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@, ;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:.(?:(?:\r\n)?[ \t] )(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\ ".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))):(?:(?:\r\n)?[ \t]))? (?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[["()<>@,;:\". []]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]))(?:.(?:(?: \r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[[ "()<>@,;:\".[]]))|"(?:[^"\r\]|\.|(?:(?:\r\n)?[ \t]))"(?:(?:\r\n)?[ \t]) ))@(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t]) +|\Z|(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t]))(?:
    .(?:(?:\r\n)?[ \t])(?:[^()<>@,;:\".[] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z |(?=[["()<>@,;:\".[]]))|[([^[]\r\]|\.)](?:(?:\r\n)?[ \t])))>(?:( ?:\r\n)?[ \t]))))?;\s*)

  • (cs) in reply to StarLite

    Even better would be really REALLY correct indenting:

    (CASE
    WHEN "Help Desk Attributes".Priority = '3-Medium' AND ("Help Desk Attributes"."TAT To Close - Days" -
    	(Case
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 4 THEN 0
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 3 THEN 0
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 2 THEN 0
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 1 THEN 0
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1
    	WHEN "- Open Date"."Day in Week" <= 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6
    	ELSE 0
    	END)
    ) <= 5 THEN 1
    WHEN "Help Desk Attributes".Priority = '4-Low' AND ("Help Desk Attributes"."TAT To Close - Days" -
    	(Case
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4
    	WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 4 THEN 0
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3
    	WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 3 THEN 0
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3
    	WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 2 THEN 0
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3
    	WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 1 THEN 0
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3
    	WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3
    	WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1
    	WHEN "- Open Date"."Day in Week" <= 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5
    	WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6
    	ELSE 0
    	END)
    ) <= 10 THEN 1
    ELSE 0
    END)
    

    It doesn't tell you how many business days are between the two dates - best I can tell, it seems to indicate if a help desk ticket is going to close within a certain number of business days (5 days for Medium, 10 days for Low). Or something like that.

  • tekiegreg (unregistered)

    Maybe I should somewhat obfuscate and share the 1500 line 12 UNION'd, multi join on subquery monster that I get to occasionally deal with in my job....I'd almost wish for today's WTF...

  • Brad (unregistered) in reply to StarLite
    StarLite:
    I guess it would be a a lot better if it was indented properly.

    (CASE WHEN "Help Desk Attributes".Priority = '3-Medium' AND ("Help Desk Attributes"."TAT To Close - Days" - (Case WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 END)) <= 5 THEN 1

    	WHEN "Help Desk Attributes".Priority = '4-Low' 
    	AND ("Help Desk Attributes"."TAT To Close - Days" - (Case WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    	AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 
    	AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 
    	END)) <= 10 THEN 1 ELSE 0 
    

    END)

    Still quite WTF tho ;)

    Addendum (2008-04-02 08:40): I guess it would be a a lot better if it was indented properly.

    (CASE 
    	WHEN "Help Desk Attributes".Priority = '3-Medium' AND 
    		("Help Desk Attributes"."TAT To Close - Days" - 
    			(Case 
    			WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    			AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 
    			AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 
    			END)) <= 5 THEN 1 
    			
    		WHEN "Help Desk Attributes".Priority = '4-Low' 
    		AND ("Help Desk Attributes"."TAT To Close - Days" - (Case WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 0 THEN 0 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 5 THEN 1 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 6 THEN 2 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 12 THEN 3 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 13 THEN 4 WHEN "- Open Date"."Day in Week" = 1 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 19 THEN 5 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 4 THEN 0 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 5 THEN 1 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 11 THEN 2 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 12 THEN 3 WHEN "- Open Date"."Day in Week" = 2 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 18 THEN 4 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 3 THEN 0 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 4 THEN 1 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 10 THEN 2 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 11 THEN 3 WHEN "- Open Date"."Day in Week" = 3 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 17 THEN 4 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 2 THEN 0 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 3 THEN 1 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 9 THEN 2 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 10 THEN 3 WHEN "- Open Date"."Day in Week" = 4 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 16 THEN 4 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 1 THEN 0 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 2 THEN 1 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 8 THEN 2 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 9 THEN 3 WHEN "- Open Date"."Day in Week" = 5 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 15 THEN 4 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 7 THEN 2 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 8 THEN 3 WHEN "- Open Date"."Day in Week" = 6 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 14 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" BETWEEN -1 
    		AND 0 THEN 0 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 1 THEN 1 WHEN "- Open Date"."Day in Week" <= 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 7 THEN 3 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 13 THEN 4 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" = 14 THEN 5 WHEN "- Open Date"."Day in Week" = 7 
    		AND "Help Desk Attributes"."TAT To Close - Days" <= 20 THEN 6 ELSE 0 
    		END)) <= 10 THEN 1 ELSE 0 
    END)
    

    Still quite WTF tho ;)

    Bored much?????????????

  • (cs) in reply to Brad
    Brad:
    (Lots of Crap)

    Bored much?????????????

    Thanks for quoting his ENTIRE post. I needed to see that code one more time to really get my morning going.

  • SQLFormatPedant (unregistered) in reply to StarLite

    I don't think your formatting should start a new line for the "AND" in "BETWEEN -1 AND 4" for example - confuses rather than simplifies understanding.

    Also did you spot the deliberate mistake in the code? "WHEN "- Open Date"."Day in Week" <= 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 76 THEN 2" obviously should be "WHEN "- Open Date"."Day in Week" <= 7 AND "Help Desk Attributes"."TAT To Close - Days" <= 6 THEN 2"

    WTF!

  • Metal Lord (unregistered)

    I hear that if you read this code out loud, you conjure up a viking sun god and the easter bunny, and in the end it turns up that they're both Tyler Durden

  • Henrik (unregistered)

    This code is written by some evil person who want everyone that looks at it to commit suicide.

  • silent d (unregistered) in reply to StarLite
    StarLite:
    I guess it would be a a lot better if it was indented properly.

    CASE WHEN code = 'ridiculous' THEN 'WTF' WHEN code = 'ridiculous' AND indentation = 'proper' THEN 'WTF' ELSE 'WTH' END

  • Kuba (unregistered) in reply to Henrik
    Henrik:
    This code is written by some evil person who want everyone that looks at it to commit suicide.

    Probably 1% of "enterprise grade" code is written exactly this way (a 1500 liner where 10 lines suffice), and the people who do it think no less of themselves. That's the real WTF.

  • erlando (unregistered) in reply to StarLite
    StarLite:
    I guess it would be a a lot better if it was indented properly.

    SNIP ...

    My inner coder just died a horrible flaming death. I will now go dig holes for a living for the rest of my life.

  • NightGod (unregistered)

    I just...wait...what?

  • (cs) in reply to WC
    WC:
    Somehow, that the reformatting only serves to highlight just how crazy it actually is. Before, it just -seemed- crazy. Now I know it is.
    It does look a little better with indentation. The same way a turd looks better than a turd that has been stepped on and smeared on the sidewalk...
  • fizze (unregistered)

    I shall show this code to my intern whenever he claims some (my) SQL code is hard to read ;-)

  • Easter Bunny (unregistered) in reply to Metal Lord
    Metal Lord:
    I hear that if you read this code out loud, you conjure up a viking sun god and the easter bunny, and in the end it turns up that they're both Tyler Durden

    Hey don't blame this crap on me man!

    All I do is drop candy turds on your lawn. For this ... you need IBM.

  • inhibeo (unregistered)

    FileNotFound

  • p (unregistered) in reply to Vollhorst

    Will this query DSN server to check is the non local part of the address resolves properly.

  • p (unregistered) in reply to Vollhorst

    Will this query DSN server to check is the non local part of the address resolves properly?

  • AJ (unregistered) in reply to Dan

    I worked for a subprime lender for about 5 years, and the actual approval code looks more like this:

    public static bool ApproveLoan() { return Borrower.HasPulse; }

  • (cs)

    Holy Freakin' God!

    I think someone needs to create a Bulwer-Lytton Fiction Contest for computer programming languages. That would certainly provide an outlet for monstrosities such as this.

  • (cs) in reply to Henrik
    Henrik:
    This code is written by some evil person who want everyone that looks at it to commit suicide.

    It's like that video from The Ring. You have to show the code to 5 other people or you will die.

  • (cs) in reply to Jetts
    Jetts:
    Brad:
    (Lots of Crap)

    Bored much?????????????

    Thanks for quoting his ENTIRE post. I needed to see that code one more time to really get my morning going.

    Quick! Somebody get MPS!

  • (cs) in reply to savar
    savar:
    It's like that video from The Ring. You have to show the code to 5 other people or you will die.

    That's exactly how I feel after seeing this.

  • [twisti] (unregistered) in reply to akatherder
    akatherder:
    WHERE ARE THE LOLCATS?!

    Thanks for proving that the "approved" comments are worthless junk as well.

  • Daniel (unregistered)

    Holy crap, look at that!! :S

  • (cs)

    can I guess that the poster listens to the NPR Wait Wait podcast?

  • Smash (unregistered) in reply to NightGod
    I hear that if you read this code out loud, you conjure up a viking sun god and the easter bunny
    NightGod:
    I just...wait...what?
    Dont worry pal, the whole sungod thing was just a joke. OTOH, the easter bunny part was very serious.
  • Martin (unregistered)

    "Shoot the hostage." -- Officer Jack Traven "Speed"

Leave a comment on “Pop Quiz, Hotshot”

Log In or post as a guest

Replying to comment #:

« Return to Article