Up against a SQL question that is difficult to code.  Any help is greatly appreciated.