SpiderFlight
Programmer
I have a select into query (see below). The problem is I'd like to force the data type to be TEXT for these 2 column dbo_medstat_physician_role.phys_id AS [upin#], dbo_medstat_patient_visit.hosp_id.
Is this possible?
SELECT dbo_medstat_patient_visit.case_mix_id, dbo_medstat_physician_role.phys_id AS [upin#], dbo_medstat_patient_visit.hosp_id INTO tmpPhysUpin
FROM dbo_medstat_patient_visit INNER JOIN dbo_medstat_physician_role ON dbo_medstat_patient_visit.case_mix_id = dbo_medstat_physician_role.case_mix_id
WHERE (((dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkNorfolk]=True,"1","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkLeigh]=True,"2","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkHampton]=True,"3","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkBayside]=True,"4","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkVB]=True,"5","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkWilliamsburg]=True,"6","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkOBICI]=True,"7","")) AND ((dbo_medstat_physician_role.phys_role)="D") AND ((dbo_medstat_patient_visit.disch_date)>=[Forms]![frmInput]![txtFrom] And (dbo_medstat_patient_visit.disch_date)<=[forms]![frmInput]![txtTo]));
Is this possible?
SELECT dbo_medstat_patient_visit.case_mix_id, dbo_medstat_physician_role.phys_id AS [upin#], dbo_medstat_patient_visit.hosp_id INTO tmpPhysUpin
FROM dbo_medstat_patient_visit INNER JOIN dbo_medstat_physician_role ON dbo_medstat_patient_visit.case_mix_id = dbo_medstat_physician_role.case_mix_id
WHERE (((dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkNorfolk]=True,"1","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkLeigh]=True,"2","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkHampton]=True,"3","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkBayside]=True,"4","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkVB]=True,"5","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkWilliamsburg]=True,"6","") Or (dbo_medstat_patient_visit.hosp_id)=IIf([forms]![frmInput].[chkOBICI]=True,"7","")) AND ((dbo_medstat_physician_role.phys_role)="D") AND ((dbo_medstat_patient_visit.disch_date)>=[Forms]![frmInput]![txtFrom] And (dbo_medstat_patient_visit.disch_date)<=[forms]![frmInput]![txtTo]));