我正在尝试stored procedure
在我的内部写sql command
,如图所示:
Dim tdate As String = Me.PresentDate.Value.ToString("MM-dd-yyyy")
myCommand As New SqlCommand("select c.description as 'provider',b.lastname,
b.firstname, b.middleinitial,convert(varchar(10),b.dob,101) as DOB,
b.chartID,b.sex, d.businessname,d.businessfax from patientappointmentbase as a,
patientlistbase as b,resourcebase as c, locationbase as d where convert(varchar(10),
a.starttime,101) = " & tdate & "
and a.patientid = b.patientid and a.resourceid = c.resourceid and
a.locationid = d.locationid order by provider, lastname, firstname", myConnection)
当我运行此代码时,我收到错误消息
Conversion failed when converting the varchar value '08/22/1954' to data type int.