asis razul, i think i´m wrong in my last post, you don´t need declare the variables, try the code above but can you put here the output of your first query.
SELECT PIMSADM_MHMDS_OPATT_E.PTID AS OPATT, PIMSADM_MHMDS_OPATT_E.EVENTDATE, Left([EVENTDATE],2) & Mid([EVENTDATE],3,3) &...