Está en la página 1de 10

SELECT CASE

WHEN MONTH(FECHA) = 1 THEN 'ENERO'


WHEN MONTH(FECHA) = 2 THEN 'FEBRERO'
WHEN MONTH(FECHA) = 3 THEN 'MARZO'
WHEN MONTH(FECHA) = 4 THEN 'ABRIL'
WHEN MONTH(FECHA) = 5 THEN 'MAYO'
WHEN MONTH(FECHA) = 6 THEN 'JUNIO'
WHEN MONTH(FECHA) = 7 THEN 'JULIO'
WHEN MONTH(FECHA) = 8 THEN 'AGOSTO'
WHEN MONTH(FECHA) = 9 THEN 'SEPTIEMBRE'
WHEN MONTH(FECHA) = 10 THEN 'OCTUBRE'
WHEN MONTH(FECHA) = 11 THEN 'NOVIEMBRE'
WHEN MONTH(FECHA) = 12 THEN 'DICIEMBRE'
END MES,
RIGHT(FECHA,2)+'/'+LEFT(RIGHT(FECHA,4),2)+'/'+LEFT(FECHA,4)+AGENTNAME AS
CONCANOM,
LEFT(RIGHT(LOGIN,8),5)LOG_IN,
LEFT(RIGHT(LOGOUT,8),5)LOG_OUT,
LOGIN,
LOGOUT,
RIGHT(FECHA,2)+'/'+LEFT(RIGHT(FECHA,4),2)+'/'+LEFT(FECHA,4)AS FECHA,
USERNAME,
AGENTNAME,
CAST(TOTALDURATION AS DATETIME)TOTALDURATION,
CAST(SKILL AS INT)SKILL,
SKILLNAME,
LEFT(RIGHT(LOGIN,8),5)+'-'+LEFT(RIGHT(LOGOUT,8),5)AS HORARIO_CON
FROM DBO.REPORTE_LOGINLOGOUT_ATENTO
WHERE MONTH(FECHA )=12
AND USERNAME IN (
'AGG00626',
'AGG01127',
'AGG01661',
'AGG03059',
'AGG03102',
'AGG04658',
'AGG04958',
'AGG04995',
'AGG05003',
'AGG05035',
'AGG05174',
'AGG05224',
'AGG05450',
'AGG06982',
'AGG07870',
'AGG07879',
'AGG07977',
'AGG08102',
'AGG08206',
'AGG08338',
'AGG08665',
'AGG08710',
'AGG08715',
'AGG08802',
'AGG08823',
'AGG08999',
'AGG09093',
'AGG09173',
'AGG09175',
'AGG09181',
'AGG09240',

'AGG09273',
'AGG09389',
'AGG09475',
'AGG09480',
'AGG09494',
'AGG09831',
'AGG09861',
'AGG09923',
'AGG09928',
'AGG09934',
'AGG09975',
'AGG10014',
'AGG10254',
'AGG10373',
'AGG10383',
'AGG10386',
'AGG10391',
'AGG10403',
'AGG10410',
'AGG10768',
'AGG10795',
'AGG10925',
'AGG10944',
'AGG11055',
'AGG11081',
'AGG11132',
'AGG11137',
'AGG11139',
'AGG11149',
'AGG11160',
'AGG11161',
'AGG11164',
'AGG11175',
'AGG11180',
'AGG11181',
'AGG11182',
'AGG11198',
'AGG11223',
'AGG11229',
'AGG11248',
'AGG11251',
'AGG11254',
'AGG11255',
'AGG11257',
'AGG11262',
'AGG11267',
'AGG11272',
'AGG11290',
'AGG11301',
'AGG11328',
'AGG11392',
'AGG11400',
'AGG11414',
'AGG11418',
'AGG11515',
'AGG11516',
'AGG11549',
'AGG11562',
'AGG11582',
'AGG11583',
'AGG11588',

'AGG11591',
'AGG11601',
'AGG11606',
'AGG11807',
'AGG11815',
'AGG11895',
'AGG11898',
'AGG11900',
'AGG11910',
'AGG11962',
'AGG11973',
'AGG12063',
'AGG12182',
'AGG12189',
'AGG12190',
'AGG12193',
'AGG12195',
'AGG12212',
'AGG12393',
'AGG12396',
'AGG12406',
'AGG12414',
'AGG12423',
'AGG12433',
'AGG12436',
'AGG12463',
'AGG12537',
'AGG12563',
'AGG12623',
'AGG12630',
'AGG12668',
'AGG12672',
'AGG12676',
'AGG12679',
'AGG12680',
'AGG12721',
'AGG12727',
'AGG12745',
'AGG12746',
'AGG12747',
'AGG12834',
'AGG12843',
'AGG12861',
'AGG12869',
'AGG12898',
'AGG12919',
'AGG12922',
'AGG12977',
'AGG12980',
'AGG12985',
'AGG12998',
'AGG13008',
'AGG13012',
'AGG13013',
'AGG13017',
'AGG13107',
'AGG13135',
'AGG13151',
'AGG13155',
'AGG13168',
'AGG13218',

'AGG13222',
'AGG13267',
'AGG13268',
'AGG13269',
'AGG13278',
'AGG13363',
'AGG13417',
'AGG13418',
'AGG13436',
'AGG13511',
'AGG13525',
'AGG13610',
'AGG13617',
'AGG13711',
'AGG13712',
'AGG13717',
'AGG13721',
'AGG13725',
'AGG13864',
'AGG13868',
'AGG13897',
'AGG13902',
'AGG13906',
'AGG13951',
'AGG13957',
'AGG13959',
'AGG13965',
'AGG13966',
'AGG13969',
'AGG13970',
'AGG13976',
'AGG14060',
'AGG14099',
'AGG14102',
'AGG14349',
'AGG14625',
'AGG14749',
'AGG14753',
'AGG14758',
'AGG14762',
'AGG14766',
'AGG14768',
'AGG15214',
'AGG15904',
'AGG15916',
'AGG15924',
'AGG15945',
'AGG15947',
'AGG15957',
'AGG15961',
'AGG15974',
'AGG15975',
'AGG15980',
'AGG16031',
'AGG16265',
'AGG16270',
'AGG16271',
'AGG16277',
'AGG16291',
'AGG16293',
'AGG16344',

'AGG16353',
'AGG16355',
'AGG16360',
'AGG16367',
'AGG16388',
'AGG16393',
'AGG16394',
'AGG16396',
'AGG16433',
'AGG16435',
'AGG16922',
'AGG16923',
'AGG16924',
'AGG16942',
'AGG16945',
'AGG16954',
'AGG16957',
'AGG16960',
'AGG16976',
'AGG16980',
'AGG16985',
'AGG16991',
'AGG17026',
'AGG17029',
'AGG17032',
'AGG17034',
'AGG17035',
'AGG17036',
'AGG17039',
'AGG17042',
'AGG17045',
'AGG17053',
'AGG17062',
'AGG17069',
'AGG17075',
'AGG17104',
'AGG17114',
'AGG17118',
'AGG17120',
'AGG17136',
'AGG17154',
'AGG17155',
'AGG17167',
'AGG17169',
'AGG17172',
'AGG17178',
'AGG17190',
'AGG17191',
'AGG17192',
'AGG17198',
'AGG17200',
'AGG17223',
'AGG17229',
'AGG17230',
'AGG17231',
'AGG17235',
'AGG17236',
'AGG17242',
'AGG17243',
'AGG17246',
'AGG17247',

'AGG17250',
'AGG17264',
'AGG17277',
'AGG17282',
'AGG17286',
'AGG17290',
'AGG17292',
'AGG17293',
'AGG17295',
'AGG17296',
'AGG17297',
'AGG17298',
'AGG17301',
'AGG17302',
'AGG17305',
'AGG17306',
'AGG17307',
'AGG17308',
'AGG17312',
'AGG17316',
'AGG17319',
'AGG17320',
'AGG17324',
'AGG17332',
'AGG17336',
'AGG17350',
'AGG17354',
'AGG17355',
'AGG17358',
'AGG17359',
'AGG17366',
'AGG17372',
'AGG17373',
'AGG17386',
'AGG17392',
'AGG17405',
'AGG17407',
'AGG17411',
'AGG17415',
'AGG17437',
'AGG17443',
'AGG17445',
'AGG17449',
'AGG17460',
'AGG17461',
'AGG17465',
'AGG17468',
'AGG17473',
'AGG17475',
'AGG17477',
'AGG17486',
'AGG17491',
'AGG17492',
'AGG17497',
'AGG17501',
'AGG17508',
'AGG17509',
'AGG17515',
'AGG17521',
'AGG17529',
'AGG17531',

'AGG17532',
'AGG17533',
'AGG17540',
'AGG17545',
'AGG17556',
'AGG17557',
'AGG17560',
'AGG17563',
'AGG17565',
'AGG17566',
'AGG17571',
'AGG17588',
'AGG17589',
'AGG17590',
'AGG17591',
'AGG17592',
'AGG17593',
'AGG17597',
'AGG17598',
'AGG17601',
'AGG17602',
'AGG17603',
'AGG17604',
'AGG17608',
'AGG17612',
'AGG17613',
'AGG17614',
'AGG17616',
'AGG17617',
'AGG17674',
'AGG17675',
'AGG17678',
'AGG17679',
'AGG17681',
'AGG17685',
'AGG17686',
'AGG17688',
'AGG17689',
'AGG17692',
'AGG17697',
'AGG17705',
'AGG17711',
'AGG17749',
'AGG17750',
'AGG17818',
'AGG17819',
'AGG17822',
'AGG17823',
'AGG17824',
'AGG17827',
'AGG17830',
'AGG17836',
'AGG17837',
'AGG17839',
'AGG17840',
'AGG17845',
'AGG17850',
'AGG17853',
'AGG17898',
'AGG17902',
'AGG17903',

'AGG17907',
'AGG17908',
'AGG17909',
'AGG17910',
'AGG17913',
'AGG17914',
'AGG17915',
'AGG17999',
'AGG18000',
'AGG18001',
'AGG18002',
'AGG18003',
'AGG18008',
'AGG18009',
'AGG18011',
'AGG18012',
'AGG18017',
'AGG18093',
'AGG18094',
'AGG18095',
'AGG18096',
'AGG18097',
'AGG18098',
'AGG18099',
'AGG18100',
'AGG18101',
'AGG18103',
'AGG18106',
'AGG18107',
'AGG18143',
'AGG18144',
'AGG18145',
'AGG18146',
'AGG18147',
'AGG18148',
'AGG18149',
'AGG18153',
'AGG18194',
'AGG18196',
'AGG18197',
'AGG18198',
'AGG18199',
'AGG18201',
'AGG18203',
'AGG18204',
'AGG18205',
'AGG18206',
'AGG18207',
'AGG18208',
'AGG18209',
'AGG18211',
'AGG18212',
'ASV00060',
'ASV00061',
'ASV00062',
'ASV00067',
'ASV00068',
'ASV00071',
'ASV00073',
'ASV00074',
'ASV00075',

'ASV00079',
'ASV00080',
'ASV00081',
'ASV00082',
'ASV00083',
'ASV00086',
'ASV00087',
'ASV00088',
'ASV00089',
'ASV00092',
'ASV00099',
'ASV00100',
'ASV00101',
'ASV00102',
'ASV00103',
'ASV00104',
'ASV00105',
'ASV00110',
'ASV00114',
'ASV00115',
'ASV00117',
'ASV00118',
'ASV00156',
'ASV00164',
'ASV00165',
'ASV00168',
'ASV00169',
'ASV00175',
'ASV00180',
'ASV00183',
'ASV00184',
'ASV00228',
'ASV00229',
'ASV00230',
'ASV00235',
'ASV00242',
'ASV00248',
'ASV00251',
'ASV00252',
'ASV00356',
'ASV00360',
'ASV00361',
'ASV00364',
'ASV00366',
'ASV00367',
'ASV00368',
'ASV00370',
'ASV00371',
'ASV00381',
'ASV00382',
'ASV00383',
'ASV00384',
'ASV00385',
'ASV00386',
'ASV00388',
'ASV00389',
'ASV00392',
'ASV00393',
'ASV00396',
'ASV00399',
'ASV00400',

'ASV00402',
'ASV00403',
'ASV00404',
'ASV00405',
'ASV00409',
'ASV00410',
'ASV00411',
'ASV00412',
'ASV00413',
'ASV00414',
'ASV00416',
'ASV00417',
'ASV00418',
'ASV00419',
'ASV00420',
'ASV00469',
'ASV00470',
'ASV00471',
'ASV00472',
'ASV00474',
'ASV00477',
'ASV00478',
'ASV00480',
'ASV00481',
'ASV00482',
'ASV00483',
'ASV00484',
'ASV00485'
)
ORDER BY 1,AGENTNAME,SKILL,LOGOUT