Hi harfang,
I tried this with a German and English version of Access 2007 and with a string literal containing the text in the initial post, it worked in all cases - but that doesn't mean it is the best and only solution...:-)
You are right, using Format is a lot easier than this construct. I simply forgot the Format function - shame on me...:-)
So the complete thing should be:
SELECT First(CLARITY_PAT_ENC_RSN_VISIT.ENC_REASON_ID) AS Complaint,
CLARITY_PATIENT.ETHNIC_GROUP_C,
CLARITY_PATIENT.MARITAL_STATUS_C,
CLARITY_PATIENT.ADD_LINE_1,
CLARITY_PATIENT.CITY,
CLARITY_ZC_STATE.ABBR,
CLARITY_ZC_COUNTY.NAME AS County,
CLARITY_PATIENT.SEX,
CLARITY_PATIENT.PAT_LAST_NAME,
CLARITY_PATIENT.PAT_FIRST_NAME,
CLARITY_PATIENT.BIRTH_DATE,
Format(CLARITY_PAT_ENC_HSP.ADT_ARRIVAL_TIME, "mm/dd/yyyy") AS ArrvDt,
CLARITY_PATIENT.PAT_MRN_ID AS MRN,
CLARITY_PATIENT.ZIP, First(CLARITY_PATIENT.HOME_PHONE) AS [Home Phone],
CLARITY_PATIENT.SSN,
CLARITY_PAT_ENC_HSP.HSP_ACCOUNT_ID,
CLARITY_PAT_ENC_HSP.ED_DISPOSITION_C,
Format(CLARITY_PAT_ENC_HSP.ADT_ARRIVAL_TIME,"hh:mm") As ArrvTm
INTO [Extract]
FROM CLARITY_PAT_ENC_DX RIGHT JOIN (((((CLARITY_PATIENT INNER JOIN CLARITY_ZC_MARITAL_STATUS ON CLARITY_PATIENT.MARITAL_STATUS_C = CLARITY_ZC_MARITAL_STATUS.MARITAL_STATUS_C) INNER JOIN CLARITY_PAT_ENC_HSP ON CLARITY_PATIENT.PAT_ID = CLARITY_PAT_ENC_HSP.PAT_ID) INNER JOIN CLARITY_PAT_ENC_RSN_VISIT ON CLARITY_PAT_ENC_HSP.PAT_ENC_CSN_ID = CLARITY_PAT_ENC_RSN_VISIT.PAT_ENC_CSN_ID) INNER JOIN CLARITY_ZC_STATE ON CLARITY_PATIENT.STATE_C = CLARITY_ZC_STATE.STATE_C) INNER JOIN CLARITY_ZC_COUNTY ON CLARITY_PATIENT.COUNTY_C = CLARITY_ZC_COUNTY.COUNTY_C) ON CLARITY_PAT_ENC_DX.PAT_ENC_CSN_ID = CLARITY_PAT_ENC_HSP.PAT_ENC_CSN_ID
WHERE (((CLARITY_PAT_ENC_HSP.ED_EPISODE_ID) Is Not Null))
GROUP BY CLARITY_PATIENT.ETHNIC_GROUP_C, CLARITY_PATIENT.MARITAL_STATUS_C, CLARITY_PATIENT.ADD_LINE_1, CLARITY_PATIENT.CITY, CLARITY_ZC_STATE.ABBR, CLARITY_ZC_COUNTY.NAME, CLARITY_PATIENT.SEX, CLARITY_PATIENT.PAT_LAST_NAME, CLARITY_PATIENT.PAT_FIRST_NAME, CLARITY_PATIENT.BIRTH_DATE, CLARITY_PAT_ENC_HSP.ADT_ARRIVAL_TIME, CLARITY_PATIENT.PAT_MRN_ID, CLARITY_PATIENT.ZIP, CLARITY_PATIENT.SSN, CLARITY_PAT_ENC_HSP.HSP_ACCOUNT_ID, CLARITY_PAT_ENC_HSP.ED_DISPOSITION_C, CLARITY_PAT_ENC_HSP.ADT_ARRIVAL_TIME
HAVING (((CLARITY_PAT_ENC_HSP.ADT_ARRIVAL_TIME) Between [start] And [end]) AND ((CLARITY_PAT_ENC_HSP.ED_DISPOSITION_C) Is Null Or (CLARITY_PAT_ENC_HSP.ED_DISPOSITION_C)<>"1180"));
Cheers,
Christian