Help with Query

  • Please note that I am using Sybase ASE

    Consider the following sample data:

    IF OBJECT_ID('dbo.nfg2562_d') IS NOT NULL

    BEGIN

    DROP TABLE dbo.nfg2562_d

    END

    GO

    CREATE TABLE dbo.nfg2562_d (

    account_number VARCHAR(17) NULL,

    acex_id int,

    expense_group VARCHAR(50) NULL,

    effective_date datetime NULL,

    expense_group_line_id int NULL,

    process_description VARCHAR(50) NULL,

    expense_amount decimal(10, 2) NULL,

    expense_percent decimal(10, 2) NULL

    )

    GO

    INSERT INTO dbo.nfg2562_d

    SELECT 'N104897', 100029956, 'Nucleus', '20080403', 100006117, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N104897', 100082174, 'Nucleus', '20120727', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N104898', 100053920, 'Version 1', '20080403', 100006118, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N104898', 100130767, 'Nucleus', '20140508', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N104899', 100043777, 'Version 1', '20080403', 100006119, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N104899', 100130766, 'Nucleus', '20140508', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N105158', 100032952, 'Version 1', '20080701', 100006396, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N105158', 100119586, 'Nucleus', '20131220', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N105491', 100034334, 'Version 1', '20080512', 100006727, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N105491', 100107147, 'Nucleus', '20130808', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N105493', 100065333, 'Version 1', '20080430', 100006724, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N105493', 100107145, 'Nucleus', '20130808', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N106071', 100003135, 'Version 1', '20080530', 100007361, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N106071', 100092005, 'Nucleus', '20130121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N110432', 100017629, 'Version 1', '20081212', 100013955, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N110432', 100130353, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N111009', 100027342, 'Version 1', '20090116', 100015593, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N111009', 100101880, 'Nucleus', '20130604', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N111825', 100039255, 'Version 1', '20090220', 100016444, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N111825', 100109449, 'Nucleus', '20130913', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N111945', 100046790, 'Version 1', '20090227', 100016566, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N111945', 100101881, 'Nucleus', '20130604', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N113983', 100043208, 'Version 1', '20090430', 100020725, 'Trailing Comm', 0.00, 0.95 UNION ALL

    SELECT 'N113983', 100119245, 'Nucleus', '20131217', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N113986', 100016876, 'Version 1', '20090430', 100020729, 'Trailing Comm', 0.00, 0.95 UNION ALL

    SELECT 'N113986', 100119247, 'Nucleus', '20131217', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N114466', 100047890, 'Version 1', '20090519', 100021260, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N114466', 100085785, 'Nucleus', '20120925', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N114796', 100011086, 'Version 1', '20090528', 100021609, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N114796', 100085787, 'Nucleus', '20120925', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N114978', 100002874, 'Version 1', '20090602', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N114978', 100102141, 'Nucleus', '20130607', 100127908, 'Trailing Comm', 0.00, 0.60 UNION ALL

    SELECT 'N114978', 100102417, 'Version 1', '20130612', 100128223, 'Trailing Comm', 0.00, 0.60 UNION ALL

    SELECT 'N116793', 100035689, 'Version 1', '20090722', 100023657, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N116793', 100095223, 'Nucleus', '20130227', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N117075', 100025770, 'Version 1', '20090730', 100023980, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N117075', 100085784, 'Nucleus', '20120925', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N117333', 100013309, 'Version 1', '20090806', 100024258, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N117333', 100130348, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N117335', 100008506, 'Version 1', '20090806', 100024259, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N117335', 100130349, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N117834', 100006734, 'Version 1', '20090824', 100024806, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N117834', 100093243, 'Nucleus', '20130211', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N117841', 100043807, 'Version 1', '20090824', 100024812, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N117841', 100093244, 'Nucleus', '20130211', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N118453', 100019013, 'Version 1', '20090910', 100028938, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N118453', 100130350, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N119004', 100067082, 'Version 1', '20090925', 100026129, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N119004', 100130351, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N119005', 100020882, 'Version 1', '20090925', 100026125, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N119005', 100130352, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N121307', 100055410, 'Version 1', '20091120', 100029689, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N121307', 100128777, 'Nucleus', '20140403', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N121308', 100014191, 'Version 1', '20091120', 100029692, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N121308', 100128784, 'Nucleus', '20140403', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N123916', 100009832, 'Version 1', '20100122', 100032622, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N123916', 100115925, 'Nucleus', '20131118', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N124248', 100067374, 'Version 1', '20100129', 100032976, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N124248', 100128189, 'Nucleus', '20140331', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N129605', 100111447, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N124251', 100002389, 'Version 1', '20100129', 100032980, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N124251', 100128187, 'Nucleus', '20140331', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N125720', 100059021, 'Version 1', '20100224', 100034599, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N125720', 100124254, 'Nucleus', '20140305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N125721', 100055915, 'Version 1', '20100224', 100034598, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N125721', 100124255, 'Nucleus', '20140305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N125733', 100009103, 'Version 1', '20100224', 100034612, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N125733', 100129529, 'Nucleus', '20140415', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N125733', 100131481, 'Version 1', '20140520', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N126563', 100009908, 'Version 1', '20100308', 100035518, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N126563', 100088057, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N126564', 100044197, 'Version 1', '20100308', 100035517, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N126564', 100088058, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N127040', 100064237, 'Version 1', '20100315', 100036047, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N127040', 100120689, 'Nucleus', '20140117', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N127280', 100046180, 'Version 2', '20100317', 100036317, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N127280', 100112835, 'Nucleus', '20131017', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N128492', 100054679, 'Version 1', '20100319', 100037643, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N128492', 100124256, 'Nucleus', '20140305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N128493', 100024393, 'Version 1', '20100319', 100037644, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N128493', 100124257, 'Nucleus', '20140305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N128549', 100019550, 'Version 1', '20100326', 100037708, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N128549', 100124574, 'Nucleus', '20140311', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N129113', 100009141, 'Version 1', '20100331', 100038338, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N129113', 100121851, 'Nucleus', '20140131', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N129117', 100033724, 'Version 1', '20100331', 100038343, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N129117', 100122010, 'Nucleus', '20140204', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N129544', 100050521, 'Version 1', '20100410', 100038844, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N129544', 100129517, 'Nucleus', '20140415', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N129605', 100017209, 'Version 1', '20100412', 100038908, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N129963', 100016021, 'Version 1', '20100419', 100039348, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N129963', 100120685, 'Nucleus', '20140117', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N131289', 100052094, 'Version 1', '20100513', 100040859, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N131289', 100111449, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N132260', 100055557, 'Version 1', '20100528', 100042923, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N132260', 100117967, 'Nucleus', '20131203', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N132263', 100016792, 'Version 1', '20100528', 100042926, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N132263', 100125024, 'Nucleus', '20140314', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N132341', 100063737, 'Version 1', '20100528', 100043021, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N132341', 100088054, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N132342', 100062683, 'Version 1', '20100528', 100043022, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N132342', 100125914, 'Nucleus', '20140315', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N132343', 100059056, 'Version 1', '20100528', 100043023, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N132343', 100125917, 'Nucleus', '20140315', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N133960', 100005743, 'Version 1', '20100629', 100044915, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N133960', 100130595, 'Nucleus', '20140506', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N134267', 100011708, 'Version 1', '20100705', 100045266, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N134267', 100088049, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N135347', 100033563, 'Version 1', '20100722', 100046502, 'Trail Comm Bond', 0.00, 0.50 UNION ALL

    SELECT 'N135347', 100116264, 'Nucleus', '20131122', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N137931', 100043436, 'Version 1', '20100910', 100049454, 'Trail Comm Bond', NULL, 0.00 UNION ALL

    SELECT 'N137931', 100102182, 'Nucleus', '20130607', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N138039', 100026161, 'Nucleus', '20100914', 100049572, 'Trail Comm Bond', 0.00, 0.50 UNION ALL

    SELECT 'N138039', 100130083, 'Version 1', '20140426', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N138157', 100045834, 'Version 1', '20100916', 100049707, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N138157', 100101882, 'Nucleus', '20130604', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N138162', 100008307, 'Version 1', '20100916', 100049713, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N138162', 100101879, 'Nucleus', '20130604', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N138820', 100004823, 'Version 1', '20100928', 100050499, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N138820', 100097148, 'Nucleus', '20130307', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N139028', 100066444, 'Version 1', '20101001', 100050726, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N139028', 100087294, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N139049', 100050712, 'Version 1', '20101001', 100050751, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N139049', 100113085, 'Nucleus', '20131022', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N139050', 100010035, 'Version 1', '20101001', 100050749, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N139050', 100113089, 'Nucleus', '20131022', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N139709', 100004962, 'Version 1', '20101014', 100051505, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N139709', 100129388, 'Nucleus', '20140414', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N139721', 100027137, 'Version 1', '20101014', 100051518, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N139721', 100116518, 'Nucleus', '20131126', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N139722', 100034998, 'Version 1', '20101014', 100051517, 'Trail Comm Bond', 0.00, 0.50 UNION ALL

    SELECT 'N139722', 100116515, 'Nucleus', '20131126', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140189', 100007150, 'Version 1', '20101021', 100052087, 'Trail Comm Bond', 0.00, 0.50 UNION ALL

    SELECT 'N140189', 100095755, 'Nucleus', '20130305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140213', 100045116, 'Version 1', '20101022', 100052113, 'Trail Comm Bond', 0.00, 0.75 UNION ALL

    SELECT 'N140213', 100118376, 'Nucleus', '20131207', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140268', 100016557, 'Version 1', '20101022', 100052174, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N140268', 100111737, 'Nucleus', '20131002', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140268', 100111840, 'Version 1', '20131003', 100138511, 'Trailing Comm', NULL, 0.75 UNION ALL

    SELECT 'N140680', 100051195, 'Version 1', '20101029', 100053529, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N140680', 100122812, 'Nucleus', '20140214', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140681', 100044786, 'Version 1', '20101029', 100053528, 'Trail Comm Bond', NULL, 0.00 UNION ALL

    SELECT 'N140681', 100122813, 'Nucleus', '20140214', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140830', 100061148, 'Version 1', '20101102', 100053699, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N140830', 100115798, 'Nucleus', '20131115', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140831', 100002166, 'Version 1', '20101102', 100053700, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N140831', 100115800, 'Nucleus', '20131115', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N140893', 100057724, 'Version 1', '20101102', 100053771, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N140893', 100087309, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N141177', 100020156, 'Version 1', '20101105', 100054080, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N141177', 100095748, 'Nucleus', '20130305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N141699', 100012655, 'Version 1', '20101112', 100054664, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N141699', 100111417, 'Nucleus', '20131001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N141826', 100057396, 'Version 1', '20101116', 100054806, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N141826', 100095670, 'Nucleus', '20130305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N142146', 100034815, 'Version 1', '20101119', 100055195, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N142146', 100088385, 'Nucleus', '20121113', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N142147', 100050636, 'Version 1', '20101119', 100055194, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N142147', 100088388, 'Nucleus', '20121113', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N142170', 100046638, 'Version 1', '20101119', 100055216, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N142170', 100112160, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N142523', 100034430, 'Version 1', '20101125', 100055614, 'Trailing Comm', 0.00, 0.30 UNION ALL

    SELECT 'N142523', 100088055, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N143076', 100068547, 'Version 1', '20101203', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N143076', 100085789, 'Nucleus', '20120925', 100116960, 'Trailing Comm', NULL, 0.65 UNION ALL

    SELECT 'N143159', 100057840, 'Version 1', '20101203', 100057231, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N143159', 100087722, 'Nucleus', '20121101', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N143160', 100022242, 'Version 1', '20101203', 100057229, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N143160', 100087721, 'Nucleus', '20121031', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N143205', 100002341, 'Version 1', '20101206', 100057282, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N143205', 100112161, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N143683', 100022022, 'Version 1', '20101213', 100057831, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N143683', 100088386, 'Nucleus', '20121113', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N143684', 100017558, 'Version 1', '20101213', 100057832, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N143684', 100088387, 'Nucleus', '20121113', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N144002', 100026996, 'Version 1', '20101216', 100058197, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N144002', 100112162, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N144003', 100011851, 'Version 1', '20101216', 100058196, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N144003', 100112163, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N144358', 100041965, 'Version 1', '20101221', 100058605, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N144358', 100124925, 'Nucleus', '20140314', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N144401', 100063746, 'Version 1', '20101222', 100058660, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N144401', 100124089, 'Nucleus', '20140304', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N144401', 100124410, 'Version 1', '20140307', 100152838, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N145092', 100016954, 'Version 1', '20110112', 100060351, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N145092', 100111472, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N145093', 100008160, 'Version 1', '20110112', 100060350, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N145093', 100111471, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N146848', 100055328, 'Version 1', '20110207', 100063289, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N146848', 100086300, 'Nucleus', '20121004', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N146849', 100006545, 'Version 1', '20110207', 100063288, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N146849', 100086301, 'Nucleus', '20121004', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N146920', 100065913, 'Version 1', '20110207', 100063368, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N146920', 100101883, 'Nucleus', '20130604', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147248', 100020016, 'Version 1', '20110210', 100063757, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N147248', 100086189, 'Nucleus', '20121001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147249', 100008872, 'Version 1', '20110210', 100063756, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N147249', 100086191, 'Nucleus', '20121001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147644', 100019044, 'Version 1', '20110216', 100064222, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N147644', 100111451, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147830', 100039690, 'Version 1', '20110217', 100064436, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N147830', 100129566, 'Nucleus', '20140416', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147831', 100042547, 'Version 1', '20110217', 100064434, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N147831', 100129565, 'Nucleus', '20140416', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147894', 100021886, 'Version 1', '20110218', 100064513, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N147894', 100107809, 'Nucleus', '20130819', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N147895', 100008824, 'Version 1', '20110218', 100064512, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N147895', 100107807, 'Nucleus', '20130819', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N154261', 100130355, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N148193', 100001305, 'Version 1', '20110222', 100064863, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N148193', 100129567, 'Nucleus', '20140416', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N148267', 100067086, 'Version 1', '20110223', 100064948, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N148267', 100096798, 'Nucleus', '20130320', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N148268', 100063863, 'Version 1', '20110223', 100064947, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N148268', 100096799, 'Nucleus', '20130320', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N148312', 100056781, 'Version 1', '20110224', 100064993, 'Trailing Comm', NULL, 0.35 UNION ALL

    SELECT 'N148312', 100088059, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149061', 100017693, 'Version 1', '20110306', 100066706, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N149061', 100111489, 'Nucleus', '20131001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149078', 100020125, 'Version 1', '20110307', 100066723, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N149078', 100088074, 'Nucleus', '20121108', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149215', 100066346, 'Version 1', '20110308', 100066885, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N149215', 100116283, 'Nucleus', '20131122', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149308', 100055527, 'Version 1', '20110308', 100066990, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N149308', 100095753, 'Nucleus', '20130305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149626', 100024418, 'Version 1', '20110311', 100067367, 'Trailing Comm', 0.00, 0.30 UNION ALL

    SELECT 'N149626', 100088063, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149873', 100035559, 'Version 1', '20110315', 100067645, 'Trail Comm Bond', 0.00, 0.50 UNION ALL

    SELECT 'N149873', 100129373, 'Nucleus', '20140414', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149912', 100053309, 'Version 1', '20110315', 100067696, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N149912', 100094472, 'Version 1', '20130301', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N149963', 100012416, 'Version 1', '20110316', 100067755, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N149963', 100111477, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150114', 100031819, 'Version 1', '20110317', 100067929, 'Trailing Comm', 0.00, 0.25 UNION ALL

    SELECT 'N150114', 100088050, 'Nucleus', '20121108', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150118', 100022827, 'Version 1', '20110317', 100067934, 'Trailing Comm', 0.00, 0.25 UNION ALL

    SELECT 'N150118', 100088052, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150156', 100032865, 'Version 1', '20110317', 100067979, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N150156', 100109354, 'Nucleus', '20130911', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150158', 100018457, 'Version 1', '20110317', 100067983, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N150158', 100109353, 'Nucleus', '20130911', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150269', 100039616, 'Version 1', '20110318', 100068111, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N150269', 100094485, 'Version 1', '20130501', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150270', 100002155, 'Version 1', '20110318', 100068112, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N150270', 100094486, 'Version 1', '20130501', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150628', 100058522, 'Version 1', '20110322', 100068516, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N150628', 100092007, 'Nucleus', '20130121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N150809', 100033035, 'Version 1', '20110323', 100068712, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N150809', 100094475, 'Version 1', '20130308', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N152152', 100010313, 'Version 1', '20110331', 100070160, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N152152', 100092004, 'Nucleus', '20130121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N152610', 100052480, 'Version 1', '20110404', 100070664, 'Trailing Comm', 0.00, 0.80 UNION ALL

    SELECT 'N152610', 100095417, 'Nucleus', '20130301', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N152826', 100025126, 'Version 1', '20110406', 100070907, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N152826', 100105542, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N152845', 100054789, 'Version 1', '20110406', 100070929, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N152845', 100092008, 'Nucleus', '20130121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N153183', 100001229, 'Version 1', '20110412', 100071339, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N153183', 100113100, 'Nucleus', '20131022', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N153184', 100028519, 'Version 1', '20110412', 100071340, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N153184', 100113084, 'Nucleus', '20131022', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N153376', 100003790, 'Version 1', '20110414', 100071571, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N153376', 100090100, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N153695', 100042625, 'Version 1', '20110419', 100071941, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N153695', 100104263, 'Nucleus', '20130625', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N154261', 100006457, 'Version 1', '20110428', 100072623, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N154261', 100128864, 'Nucleus', '20140404', 100159503, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N154261', 100128885, 'Version 1', '20140407', 100159538, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N154262', 100032844, 'Version 1', '20110428', 100072622, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N154262', 100128867, 'Nucleus', '20140404', 100159511, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N154262', 100128887, 'Version 1', '20140407', 100159540, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N154262', 100130356, 'Nucleus', '20140430', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N154549', 100067202, 'Version 1', '20110506', 100072958, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N154549', 100088062, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N155081', 100002938, 'Version 1', '20110513', 100074581, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N155081', 100105535, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N155082', 100014544, 'Version 1', '20110513', 100074582, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N155082', 100105536, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N155083', 100040389, 'Version 1', '20110513', 100074583, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N155083', 100105538, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N155097', 100040453, 'Version 1', '20110513', 100074598, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N155097', 100088060, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N155417', 100046516, 'Version 1', '20110518', 100074956, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N155417', 100090150, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N155547', 100028803, 'Version 1', '20110519', 100075106, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N155547', 100090303, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156063', 100043387, 'Nucleus', '20110526', 100075725, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N156063', 100082851, 'Nucleus', '20120802', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156345', 100032502, 'Version 1', '20110531', 100076050, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N156345', 100089993, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156590', 100007059, 'Version 1', '20110603', 100076335, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N156590', 100111452, 'Nucleus', '20131001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156810', 100037566, 'Version 1', '20110607', 100076591, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N156810', 100114649, 'Nucleus', '20131030', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156813', 100039459, 'Version 1', '20110607', 100076594, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N156813', 100114653, 'Nucleus', '20131030', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156854', 100029153, 'Version 1', '20110608', 100076641, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N156854', 100086859, 'Nucleus', '20121015', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N156950', 100037757, 'Version 1', '20110608', 100076749, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N156950', 100088076, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157000', 100052018, 'Version 1', '20110609', 100076809, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N157000', 100105378, 'Nucleus', '20130711', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157008', 100050107, 'Version 1', '20110609', 100076819, 'Trail Comm Bond', 0.00, 0.95 UNION ALL

    SELECT 'N157008', 100119246, 'Nucleus', '20140116', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157009', 100044770, 'Version 1', '20110609', 100076820, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N157009', 100105380, 'Nucleus', '20130711', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157032', 100041699, 'Version 1', '20110609', 100076855, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N157032', 100092009, 'Nucleus', '20130121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157149', 100030002, 'Version 1', '20110610', 100076976, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N157149', 100115417, 'Nucleus', '20131111', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157412', 100006523, 'Version 1', '20110615', 100077237, 'Trail Comm Bond', 0.00, 0.50 UNION ALL

    SELECT 'N157412', 100115419, 'Nucleus', '20131111', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157420', 100040982, 'Version 1', '20110615', 100077245, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N157420', 100118210, 'Nucleus', '20131206', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157421', 100042046, 'Version 1', '20110615', 100077246, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N157421', 100118211, 'Nucleus', '20131206', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157933', 100014885, 'Version 1', '20110621', 100077756, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N157933', 100088267, 'Nucleus', '20121108', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N157934', 100057905, 'Version 1', '20110621', 100077757, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N157934', 100086297, 'Nucleus', '20121004', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158073', 100035428, 'Version 1', '20110622', 100077899, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N158073', 100088720, 'Nucleus', '20121119', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158137', 100000615, 'Version 1', '20110623', 100077970, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N158137', 100105381, 'Nucleus', '20130711', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158138', 100001697, 'Version 1', '20110623', 100077971, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N158138', 100105382, 'Nucleus', '20130711', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158254', 100049657, 'Version 1', '20110624', 100078086, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N158254', 100090094, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158393', 100046193, 'Version 1', '20110627', 100078227, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N158393', 100095471, 'Nucleus', '20130501', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158487', 100037545, 'Version 1', '20110628', 100078322, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N158487', 100111498, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N158767', 100063809, 'Nucleus', '20110630', 100078610, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N158767', 100082852, 'Nucleus', '20120802', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N159481', 100060875, 'Version 1', '20110708', 100079342, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N159481', 100122206, 'Nucleus', '20131121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N159587', 100053626, 'Version 1', '20110711', 100079452, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N159587', 100103055, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N159588', 100065984, 'Version 1', '20110711', 100079453, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N159588', 100103054, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N159693', 100019990, 'Version 1', '20110712', 100079555, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N159693', 100113091, 'Nucleus', '20131022', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160065', 100064410, 'Version 1', '20110715', 100079965, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N160065', 100092006, 'Nucleus', '20130121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160849', 100066950, 'Version 1', '20110727', 100080782, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160849', 100111250, 'Nucleus', '20130925', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160946', 100024178, 'Version 1', '20110728', 100080886, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160946', 100103047, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160947', 100004175, 'Version 1', '20110728', 100080887, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160947', 100103048, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160948', 100015387, 'Version 1', '20110728', 100080888, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160948', 100103049, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160949', 100003087, 'Version 1', '20110728', 100080889, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160949', 100103050, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160950', 100062861, 'Version 1', '20110728', 100080890, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160950', 100103045, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N160951', 100056753, 'Version 1', '20110728', 100080891, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N160951', 100103046, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N161175', 100061412, 'Version 1', '20110801', 100081141, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N161175', 100103051, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N161191', 100024885, 'Version 1', '20110801', 100081156, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N161191', 100121557, 'Nucleus', '20140128', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N161210', 100006054, 'Version 1', '20110801', 100081177, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N161210', 100089990, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N161353', 100005197, 'Version 1', '20110803', 100081320, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N161353', 100113090, 'Nucleus', '20131022', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N161905', 100011433, 'Version 1', '20110810', 100081853, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N161905', 100090083, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N162833', 100019803, 'Version 1', '20110822', 100082769, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N162833', 100123240, 'Nucleus', '20140220', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N162834', 100056287, 'Version 1', '20110822', 100082770, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N162834', 100123241, 'Nucleus', '20140220', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N162918', 100018947, 'Version 1', '20110823', 100082856, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N162918', 100090079, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N163308', 100022206, 'Version 1', '20110830', 100083230, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N163308', 100128884, 'Nucleus', '20140404', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N163434', 100063281, 'Version 1', '20110831', 100083343, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N163434', 100102340, 'Nucleus', '20130611', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N163504', 100044235, 'Version 1', '20110901', 100083402, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N163504', 100090121, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N163610', 100001017, 'Version 1', '20110901', 100083506, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N163610', 100111776, 'Nucleus', '20131002', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N163970', 100064462, 'Version 1', '20110907', 100083816, 'Trailing Comm', 0.00, 0.95 UNION ALL

    SELECT 'N163970', 100119254, 'Version 1', '20131216', 100146712, 'Trailing Comm', NULL, 0.95 UNION ALL

    SELECT 'N163970', 100119249, 'Nucleus', '20131217', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N164344', 100060227, 'Version 1', '20110912', 100084112, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N164344', 100111777, 'Nucleus', '20131002', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N164697', 100068415, 'Version 1', '20110916', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N164697', 100085847, 'Nucleus', '20120926', 100115925, 'Trailing Comm', NULL, 0.65 UNION ALL

    SELECT 'N165626', 100023324, 'Version 1', '20110930', 100085264, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N165626', 100088067, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N165712', 100044835, 'Version 1', '20111003', 100085325, 'Trail Comm Bond', 0.00, 0.75 UNION ALL

    SELECT 'N165712', 100109049, 'Nucleus', '20130907', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166483', 100009095, 'Version 1', '20111013', 100086037, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N166483', 100112167, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166485', 100048075, 'Version 1', '20111013', 100086039, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N166485', 100112169, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166639', 100013672, 'Version 1', '20111014', 100086193, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N166639', 100087297, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166640', 100017713, 'Version 1', '20111014', 100086194, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N166640', 100087299, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166643', 100006729, 'Version 1', '20111015', 100086199, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N166643', 100087300, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166644', 100040545, 'Version 1', '20111015', 100086200, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N166644', 100087301, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166721', 100005011, 'Version 1', '20111017', 100086275, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N166721', 100087103, 'Nucleus', '20121019', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N166753', 100039916, 'Version 1', '20111018', 100086307, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N166753', 100088064, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N167528', 100000532, 'Version 1', '20111027', 100087075, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N167528', 100094901, 'Version 1', '20130501', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N167582', 100057403, 'Version 1', '20111028', 100087133, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N167582', 100114656, 'Nucleus', '20131030', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N167693', 100039492, 'Version 1', '20111031', 100087235, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N167693', 100087100, 'Nucleus', '20121019', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N167707', 100000082, 'Version 1', '20111031', 100087244, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N167707', 100088072, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N167913', 100003785, 'Version 1', '20111102', 100087396, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N167913', 100088065, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N167914', 100066176, 'Version 1', '20111102', 100087397, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N167914', 100088066, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N168532', 100022590, 'Version 1', '20111109', 100088034, 'Trail Comm Bond', NULL, 0.00 UNION ALL

    SELECT 'N168532', 100094446, 'Nucleus', '20130214', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N168791', 100031661, 'Nucleus', '20111115', 100088293, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N168791', 100082529, 'Nucleus', '20120806', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N169155', 100022775, 'Version 1', '20111117', 100088594, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N169155', 100107948, 'Nucleus', '20130821', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N169229', 100060134, 'Version 1', '20111118', 100088664, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N169229', 100105531, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N169230', 100035353, 'Version 1', '20111118', 100088665, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N169230', 100105533, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N170417', 100050256, 'Version 1', '20111206', 100089792, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N170417', 100087330, 'Nucleus', '20121023', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N170518', 100056598, 'Version 1', '20111207', 100089895, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N170518', 100091454, 'Nucleus', '20130108', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N170855', 100025258, 'Nucleus', '20111213', 100090227, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N170855', 100082533, 'Nucleus', '20120806', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N171618', 100068895, 'Version 1', '20111228', 100091162, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N171618', 100105107, 'Nucleus', '20130708', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N171619', 100068896, 'Version 1', '20111228', 100091163, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N171619', 100105108, 'Nucleus', '20130708', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N171620', 100068897, 'Version 1', '20111228', 100091164, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N171620', 100105111, 'Nucleus', '20130708', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N171642', 100068921, 'Version 1', '20111229', 100091190, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N171642', 100111483, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N171644', 100068923, 'Version 1', '20111229', 100091192, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N171644', 100111482, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N171955', 100069161, 'Version 1', '20120106', 100091444, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N171955', 100088069, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N172191', 100069349, 'Version 1', '20120111', 100091646, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N172191', 100129530, 'Nucleus', '20140415', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N172191', 100131480, 'Version 1', '20140520', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N172267', 100069426, 'Version 1', '20120112', 100091730, 'Trail Comm Bond', 0.00, 0.25 UNION ALL

    SELECT 'N172267', 100095451, 'Nucleus', '20130302', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N172526', 100069627, 'Version 1', '20120117', 100091940, 'Trail Comm Bond', 0.00, 0.25 UNION ALL

    SELECT 'N172526', 100095831, 'Nucleus', '20130305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N174074', 100071244, 'Nucleus', '20120209', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N174074', 100082541, 'Nucleus', '20120806', 100149171, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N174184', 100071352, 'Version 1', '20120210', 100093624, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N174184', 100111457, 'Nucleus', '20131001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N174187', 100071355, 'Version 1', '20120210', 100093628, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N174187', 100111459, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N175472', 100072496, 'Version 1', '20120228', 100094864, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N175472', 100090033, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N175588', 100072607, 'Version 1', '20120229', 100094990, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N175588', 100111473, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N175601', 100072617, 'Version 1', '20120229', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N175601', 100089782, 'Nucleus', '20121206', 100114036, 'Trail Comm Bond', 0.00, 0.00 UNION ALL

    SELECT 'N175604', 100072622, 'Version 1', '20120229', 100095006, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N175604', 100111474, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N176173', 100073115, 'Nucleus', '20120306', 100095555, 'Trailing Comm', 0.00, 0.40 UNION ALL

    SELECT 'N176173', 100082538, 'Nucleus', '20120806', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N176680', 100073576, 'Version 1', '20120313', 100096062, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N176680', 100095549, 'Nucleus', '20130304', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N176687', 100073580, 'Version 1', '20120313', 100096067, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N176687', 100095551, 'Nucleus', '20130304', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N177202', 100074064, 'Nucleus', '20120316', 100096594, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N177202', 100082530, 'Nucleus', '20120806', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N177203', 100074065, 'Nucleus', '20120316', 100096595, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N177203', 100082536, 'Nucleus', '20120806', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N177564', 100074423, 'Version 1', '20120320', 100096983, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N177564', 100088077, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N178257', 100075114, 'Version 1', '20120327', 100097757, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N178257', 100089195, 'Nucleus', '20121127', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N178264', 100075121, 'Version 1', '20120327', 100097764, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N178264', 100089965, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N178958', 100075790, 'Version 1', '20120330', 100098488, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N178958', 100098245, 'Nucleus', '20130402', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N178966', 100075794, 'Version 1', '20120330', 100098492, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N178966', 100105601, 'Nucleus', '20130715', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N179190', 100076004, 'Version 1', '20120402', 100098713, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N179190', 100120029, 'Nucleus', '20140107', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N179193', 100076008, 'Version 1', '20120402', 100098717, 'Trailing Comm', 0.00, 0.75 UNION ALL

    SELECT 'N179193', 100120028, 'Nucleus', '20140107', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N179330', 100076146, 'Version 1', '20120403', 100098871, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N179330', 100094906, 'Version 1', '20130501', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N179336', 100076152, 'Version 1', '20120403', 100098877, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N179336', 100094907, 'Version 1', '20130501', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N179755', 100076568, 'Version 1', '20120411', 100099352, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N179755', 100088053, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N179920', 100076733, 'Nucleus', '20120413', 100099535, 'Trailing Comm', 0.00, 0.40 UNION ALL

    SELECT 'N179920', 100082531, 'Nucleus', '20120806', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N180501', 100077241, 'Version 1', '20120425', 100100116, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N180501', 100094848, 'Nucleus', '20130221', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N180762', 100077475, 'Version 1', '20120427', 100100485, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N180762', 100125915, 'Nucleus', '20140315', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N181263', 100078178, 'Version 1', '20120508', 100101129, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N181263', 100122918, 'Nucleus', '20140217', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N181473', 100078386, 'Version 1', '20120510', 100101378, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N181473', 100112837, 'Nucleus', '20131017', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N181474', 100078388, 'Version 1', '20120510', 100101381, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N181474', 100111469, 'Nucleus', '20131001', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N181519', 100078432, 'Version 1', '20120511', 100101439, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N181519', 100088068, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N181918', 100078823, 'Version 1', '20120518', 100101898, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N181918', 100088073, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N182633', 100079445, 'Version 1', '20120531', 100102687, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N182633', 100122920, 'Nucleus', '20140217', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N182869', 100079680, 'Version 1', '20120607', 100102942, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N182869', 100108048, 'Nucleus', '20130822', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N182869', 100108330, 'Version 1', '20130823', 100134707, 'Trailing Comm', NULL, 0.50 UNION ALL

    SELECT 'N183533', 100080308, 'Version 1', '20120621', 100103658, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N183533', 100111456, 'Nucleus', '20130930', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N183536', 100080311, 'Version 1', '20120621', 100103661, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N183536', 100108046, 'Nucleus', '20130822', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N183536', 100108329, 'Version 1', '20130823', 100134706, 'Trailing Comm', NULL, 0.50 UNION ALL

    SELECT 'N183674', 100080447, 'Version 1', '20120625', 100103830, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N183674', 100129944, 'Nucleus', '20140424', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N183902', 100080678, 'Version 1', '20120628', 100104094, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N183902', 100103052, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N184313', 100081077, 'Version 1', '20120706', 100104542, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N184313', 100090088, 'Nucleus', '20121210', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N184411', 100081174, 'Version 1', '20120709', 100104652, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N184411', 100122876, 'Version 1', '20140213', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N184411', 100122840, 'Version 1', '20140214', 100150842, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N184411', 100123214, 'Nucleus', '20140220', 100152023, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N184649', 100081359, 'Version 1', '20120712', 100104857, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N184649', 100088075, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N184667', 100081377, 'Version 1', '20120712', 100104876, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N184667', 100112174, 'Nucleus', '20131008', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N185551', 100082241, 'Version 1', '20120730', 100105831, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N185551', 100102457, 'Nucleus', '20130613', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N185552', 100082242, 'Version 1', '20120730', 100105832, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N185552', 100102458, 'Nucleus', '20130613', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N185553', 100082243, 'Version 1', '20120730', 100105834, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N185553', 100102459, 'Nucleus', '20130613', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N185801', 100082486, 'Nucleus', '20120806', 100106103, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N185801', 100098246, 'Version 1', '20130402', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N186356', 100083098, 'Version 1', '20120817', 100106755, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N186356', 100119813, 'Nucleus', '20131231', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N187511', 100084229, 'Version 1', '20120913', 100107982, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N187511', 100088048, 'Nucleus', '20121106', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N188021', 100085702, 'Version 1', '20120925', 100109500, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N188021', 100091453, 'Nucleus', '20130108', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N188309', 100086086, 'Version 1', '20121001', 100109915, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N188309', 100131459, 'Nucleus', '20140519', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N188442', 100086224, 'Version 1', '20121003', 100110077, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N188442', 100122208, 'Nucleus', '20131121', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N188806', 100086629, 'Version 1', '20121010', 100110527, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N188806', 100122921, 'Nucleus', '20140217', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N189001', 100086843, 'Version 1', '20121015', 100110761, 'Trailing Comm', 0.00, 0.50 UNION ALL

    SELECT 'N189001', 100086926, 'Nucleus', '20121016', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N189067', 100086908, 'Version 1', '20121016', 100110836, 'Trailing Comm', 0.00, 0.95 UNION ALL

    SELECT 'N189067', 100086919, 'Nucleus', '20121017', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N189193', 100087037, 'Version 1', '20121018', 100110978, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N189193', 100092252, 'Nucleus', '20130116', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N189505', 100087390, 'Version 1', '20121024', 100111371, 'Trail Comm Bond', 0.00, 1.00 UNION ALL

    SELECT 'N189505', 100127909, 'Nucleus', '20140329', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N189564', 100087450, 'Version 1', '20121025', 100111443, 'Trailing Comm', 0.00, 1.00 UNION ALL

    SELECT 'N189564', 100094911, 'Version 1', '20130508', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N189793', 100087682, 'Version 1', '20121030', 100111693, 'Trailing Comm', 0.00, 0.00 UNION ALL

    SELECT 'N189793', 100122422, 'Nucleus', '20140207', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N190007', 100087897, 'Nucleus', '20121102', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N190007', 100100352, 'Nucleus', '20130509', 100142850, 'Trailing Comm', NULL, 0.50 UNION ALL

    SELECT 'N191479', 100089408, 'Version 1', '20121130', 100113627, 'Trailing Comm', NULL, 0.75 UNION ALL

    SELECT 'N191479', 100126151, 'Nucleus', '20140318', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N192122', 100090357, 'Version 1', '20121211', 100114664, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N192122', 100118116, 'Nucleus', '20131204', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N192123', 100090358, 'Version 1', '20121211', 100114665, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N192123', 100118117, 'Nucleus', '20131204', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N192505', 100090739, 'Version 1', '20121218', 100115077, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N192505', 100102186, 'Nucleus', '20130608', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N194811', 100093090, 'Version 1', '20130208', 100117663, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N194811', 100095666, 'Nucleus', '20130305', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N195541', 100094835, 'Version 1', '20130221', 100119499, 'Trailing Comm', NULL, 0.50 UNION ALL

    SELECT 'N195541', 100095924, 'Nucleus', '20130308', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N195551', 100094845, 'Version 1', '20130221', 100119509, 'Trailing Comm', NULL, 0.50 UNION ALL

    SELECT 'N195551', 100095925, 'Nucleus', '20130308', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N196017', 100095323, 'Version 1', '20130228', 100120043, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N196017', 100108840, 'Nucleus', '20130905', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N196221', 100095547, 'Version 1', '20130304', 100120298, 'Trailing Comm', NULL, 0.50 UNION ALL

    SELECT 'N196221', 100103053, 'Nucleus', '20130620', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N196454', 100095816, 'Version 1', '20130307', 100120837, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N196454', 100108843, 'Nucleus', '20130905', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N196494', 100095872, 'Version 1', '20130308', 100120899, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N196494', 100115396, 'Nucleus', '20131111', 100142400, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N196494', 100115514, 'Version 1', '20131112', 100142521, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N196494', 100126451, 'Nucleus', '20140320', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N196495', 100095873, 'Version 1', '20130308', 100120900, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N196495', 100115397, 'Nucleus', '20131111', 100142401, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N196495', 100115516, 'Version 1', '20131112', 100142523, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N196495', 100126452, 'Nucleus', '20140320', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N197585', 100096936, 'Version 1', '20130321', 100122091, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197585', 100115379, 'Nucleus', '20131111', 100142383, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197585', 100115495, 'Version 1', '20131112', 100142502, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197585', 100123379, 'Nucleus', '20140221', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N197590', 100096941, 'Version 1', '20130321', 100122096, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197590', 100115399, 'Nucleus', '20131111', 100142403, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197590', 100115518, 'Version 1', '20131112', 100142525, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197590', 100123377, 'Nucleus', '20140221', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N197889', 100097272, 'Version 1', '20130325', 100122466, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197889', 100115380, 'Nucleus', '20131111', 100142384, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197889', 100115496, 'Version 1', '20131112', 100142503, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197889', 100123708, 'Nucleus', '20140226', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N197900', 100097281, 'Version 1', '20130325', 100122475, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197900', 100115407, 'Nucleus', '20131111', 100142412, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197900', 100115528, 'Version 1', '20131112', 100142536, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N197900', 100123707, 'Nucleus', '20140226', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N198266', 100097645, 'Version 1', '20130327', 100122856, 'Trailing Comm', NULL, 0.65 UNION ALL

    SELECT 'N198266', 100116005, 'Nucleus', '20131119', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N198398', 100097778, 'Version 1', '20130327', 100123008, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N198398', 100105112, 'Nucleus', '20130708', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N199518', 100098902, 'Version 1', '20130415', 100124258, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199518', 100123242, 'Nucleus', '20140220', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N199519', 100098903, 'Version 1', '20130415', 100124259, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199519', 100123243, 'Nucleus', '20140220', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N199533', 100098915, 'Version 1', '20130415', 100124272, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199533', 100115400, 'Nucleus', '20131111', 100142404, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199533', 100115520, 'Version 1', '20131112', 100142527, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199533', 100126453, 'Nucleus', '20140320', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N199534', 100098916, 'Version 1', '20130415', 100124273, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199534', 100115401, 'Nucleus', '20131111', 100142405, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199534', 100115522, 'Version 1', '20131112', 100142529, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199534', 100126454, 'Nucleus', '20140320', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N199778', 100099160, 'Version 1', '20130418', 100124558, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199778', 100107011, 'Nucleus', '20130807', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N199790', 100099172, 'Version 1', '20130418', 100124571, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N199790', 100107016, 'Version 1', '20130807', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N200540', 100099921, 'Version 1', '20130501', 100125429, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200540', 100115377, 'Nucleus', '20131111', 100142381, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200540', 100115493, 'Version 1', '20131112', 100142500, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200540', 100129337, 'Nucleus', '20140411', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N200541', 100099922, 'Version 1', '20130501', 100125430, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200541', 100115378, 'Nucleus', '20131111', 100142382, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200541', 100115494, 'Version 1', '20131112', 100142501, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200541', 100129338, 'Nucleus', '20140411', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N200545', 100099926, 'Version 1', '20130501', 100125436, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200545', 100115373, 'Nucleus', '20131111', 100142377, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200545', 100115488, 'Version 1', '20131112', 100142495, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200545', 100129339, 'Nucleus', '20140411', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N200548', 100099928, 'Version 1', '20130501', 100125438, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200548', 100115381, 'Nucleus', '20131111', 100142385, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200548', 100115497, 'Version 1', '20131112', 100142504, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200548', 100124955, 'Nucleus', '20140314', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N200551', 100099932, 'Version 1', '20130501', 100125443, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200551', 100115393, 'Nucleus', '20131111', 100142397, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200551', 100115510, 'Version 1', '20131112', 100142517, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N200551', 100124954, 'Nucleus', '20140314', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N201561', 100100924, 'Version 1', '20130520', 100126554, 'Trailing Comm', NULL, 0.00 UNION ALL

    SELECT 'N201561', 100101422, 'Nucleus', '20130528', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N201854', 100101217, 'Version 1', '20130523', 100126863, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N201854', 100129706, 'Nucleus', '20140417', NULL, NULL, NULL, NULL UNION ALL

    SELECT 'N216140', 100120287, 'Version 2', '20140110', 100147918, 'Trailing Comm', NULL, 1.00 UNION ALL

    SELECT 'N216140', 100121955, 'Version 1', '20140203', NULL, NULL, NULL, NULL

    An account number can have several expense groups as defined above. For example, N104897 has two expense groups but if you notice you will see that the expense_amount and expense_percent are set to 0 on the expense group with the earliest date.

    Some account numbers have more than 2 expense groups, for example N154261. Here we can see the expense group with the latest date has NULL expense amount and parameter.

    There are two things I need help with:

    Firstly, I want to eliminate records where the latest expense group has the expense amount and percent already populated, e.g. N184411

    Secondly, I want to make sure that the latest expense group inherits the expense_amount and expense_percent from the group that has an earlier date.

    Can you please help me with this?

    Thanks.

    ---------------------------------------------------------

    It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
    David Edwards - Media lens[/url]

    Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
    Howard Zinn

  • For the first part I believe I have resolved it by removing account numbers that satisfy the below query:

    select *

    from nfg2562_d AS a

    WHERE (expense_percent IS NOT NULL OR expense_amount IS NOT NULL)

    AND effective_date = (select max(effective_date)

    FROM nfg2562_d AS b

    WHERE a.account_number = b.account_number)

    ORDER BY 1, 4

    Can someone help me with the second part please?

    ---------------------------------------------------------

    It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
    David Edwards - Media lens[/url]

    Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
    Howard Zinn

  • You are posting in a SQL Server 2008 forum. Since you're using Sybase, you're more likely to get specific assistance by posting the question in a forum dedicated to that type of database.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (6/9/2014)


    You are posting in a SQL Server 2008 forum. Since you're using Sybase, you're more likely to get specific assistance by posting the question in a forum dedicated to that type of database.

    Hi, Sybase and SQL Server were once upon a time the same thing, and they share near identical syntax even with later updates.

  • please clarify what results you are expecting for this example

    account_number acex_id expense_group effective_date expense_group_line_id process_description expense_amount expense_percent

    --------------- ----------- -------------- ----------------------- --------------------- -------------------- ---------------- --------------

    N154261 100130355 Nucleus 2014-04-30 00:00:00.000 NULL NULL NULL NULL

    N154261 100006457 Version 1 2011-04-28 00:00:00.000 100072623 Trailing Comm 0.00 1.00

    N154261 100128864 Nucleus 2014-04-04 00:00:00.000 100159503 Trailing Comm 0.00 0.00

    N154261 100128885 Version 1 2014-04-07 00:00:00.000 100159538 Trailing Comm NULL 1.00

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

  • mikeg317X (6/9/2014)


    Grant Fritchey (6/9/2014)


    You are posting in a SQL Server 2008 forum. Since you're using Sybase, you're more likely to get specific assistance by posting the question in a forum dedicated to that type of database.

    Hi, Sybase and SQL Server were once upon a time the same thing, and they share near identical syntax even with later updates.

    Yeah, in 1995. I made the switch from Sybase to SQL Server back then. They looked almost identical for a time. But T-SQL is different in the two RDBMSs and I wouldn't presume to tell someone how to write T-SQL in Sybase based on what I know of SQL Server. When it didn't work because of some proprietary quirk in one of the two systems, it would just confuse everyone involved.

    This is just a simple CREATE TABLE statement I pulled from the Sybase web site:

    CREATE TABLE borrowed_book (

    date_borrowed DATE NOT NULL,

    date_returned DATE,

    book CHAR(20)

    REFERENCES library_books (isbn),

    CHECK( date_returned >= date_borrowed )

    )

    That would crash & burn in SQL Server and we've barely even started.

    I just thought going where more people were focused on the product might be helpful. Sorry if you disagree.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • J Livingston SQL (6/9/2014)


    please clarify what results you are expecting for this example

    account_number acex_id expense_group effective_date expense_group_line_id process_description expense_amount expense_percent

    --------------- ----------- -------------- ----------------------- --------------------- -------------------- ---------------- --------------

    N154261 100130355 Nucleus 2014-04-30 00:00:00.000 NULL NULL NULL NULL

    N154261 100006457 Version 1 2011-04-28 00:00:00.000 100072623 Trailing Comm 0.00 1.00

    N154261 100128864 Nucleus 2014-04-04 00:00:00.000 100159503 Trailing Comm 0.00 0.00

    N154261 100128885 Version 1 2014-04-07 00:00:00.000 100159538 Trailing Comm NULL 1.00

    For N154261 I would want to update the expense group with the latest effective date (2014-04-30) with the expense percentage/amount from the previous expense group (2014-04-07).

    Thanks.

    ---------------------------------------------------------

    It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
    David Edwards - Media lens[/url]

    Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
    Howard Zinn

  • bearing in mind Grant's comments about the differences between the two RDBMS....probably best to follow his advice me thinks.....

    ________________________________________________________________
    you can lead a user to data....but you cannot make them think
    and remember....every day is a school day

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply