Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force Data type to Text

Status
Not open for further replies.

SpiderFlight

Programmer
Aug 22, 2001
37
US
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]));
 
dbo_?

are you using sql server as a back end?

if so, you can use cast/convert functions in your select statement on the back end...

--------------------
Procrastinate Now!
 
Yes, SQL back end. The Cast and Convert worked great!
Also, I found CSTR() will work for Access2000.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top