Click here to Skip to main content
15,917,176 members
Home / Discussions / Database
   

Database

 
QuestionHostel Reservations Pin
twsted f817-Sep-07 3:41
twsted f817-Sep-07 3:41 
AnswerRe: Hostel Reservations Pin
andyharman17-Sep-07 3:51
professionalandyharman17-Sep-07 3:51 
QuestionIssue with Select Statement... Pin
DeepToot17-Sep-07 3:21
DeepToot17-Sep-07 3:21 
Good morning.

I converted a report from Access2k to SQL Reporting and one of the sql strings that were part of a control is giving me problems and I cannot seem to run it down. I was hoping someone on here could point out the error to me.

The error message I recieve is:
Msg 403, Level 16, State 1, Line 1
Invalid operator for data type. Operator equals boolean AND, type equals varchar.

The select statement is:
SELECT tblPatients.*, <br />
tlkpProcedures.ProcedureDescription, tblPatients.PatientNumber, tblPatients.PatientHospitalNumber, tblPatients.LastName, tblPatients.FirstName, tblPatients.MiddleInitial, tblPatients.FamiliarName, tblPatients.AddressLine1, tblPatients.AddressLine2, tblPatients.City, tblPatients.State, tblPatients.Country,tblPatients.ZipCode, tblPatients.HomePhone, tblPatients.Employed, tblPatients.WorkTitle, tblPatients.EmployerName, tblPatients.WorkPhone, tblPatients.WorkPhoneExtension, tblPatients.OKToCallWork, tblPatients.PrimaryPolicyHolder, tblPatients.DateOfBirth, tblPatients.Gender, <br />
tblPatients.RaceCode, tblPatients.SocialSecurityNumber, tblPatients.EducationLevel, tblPatients.HeightEstimateInches, <br />
tblPatients.WeightEstimatePounds, tblPatients.OverweightTimeframeID, tblPatients.MaritalStatus, tblPatients.HaveChildren, <br />
tblPatients.NumberofChildren, tblPatients.DateInfoReceived, tblPatients.CompletedBy, tblPatients.HowHeardAbout, tblPatients.SurgeonReputation, <br />
tblPatients.SurgeonOfChoice, tblPatients.ProgramReputation, tblPatients.ReputationSource, tblPatients.PreferredProcedure, <br />
tblPatients.ReasonSurgeonChoiceChanged, tblPatients.CheckForSurgeonChange, tblPatients.PatientPhysician, tblPatients.PatientPsychologist, <br />
tblPatients.CPapBiPap, tblPatients.CurrentPsychologicalCare, tblPatients.CurrentCareExplanation, tblPatients.DenialDate, tblPatients.DenialID, tblPatients.ReferToDate, tblPatients.ReferToID, tblPatients.Notes, tlkpProcedures.ProcedureDescription, tlkpReferralSources.ReferralSource, tlkpSurgeonChangeReasons.SurgeonChangeReasonDescription, tlkpOverweightTimeframe.OverweightTimeframe AS HowLongOverweight, <br />
tlkpMaritalStatus.StatusName, tlkpOutPhysicians.Title, tlkpOutPhysicians.LastName AS PhysicianLastName, <br />
tlkpOutPhysicians.FirstName AS PhysicianFirstName, tlkpOutPhysicians.MiddleInitialName AS PhysicianMiddleName, <br />
tlkpOutPhysicians.OfficeAddressLine1, tlkpOutPhysicians.OfficeAddressLine2, tlkpOutPhysicians.OfficeCity, tlkpOutPhysicians.OfficeState, <br />
tlkpOutPhysicians.OfficeCountry, tlkpOutPhysicians.OfficeZipPostalCode, tlkpOutPhysicians.OfficePhone, tlkpOutPhysicians.OfficeFax, <br />
ISNULL(tlkpBWLSStaff.FirstName, NULL) & ISNULL(tlkpBWLSStaff.MiddleInitialName, NULL) & ISNULL(tlkpBWLSStaff.LastName, NULL) AS PreferredSurgeon<br />
<br />
FROM  <br />
<br />
tlkpOutPhysicians RIGHT OUTER JOIN tblPatients LEFT OUTER JOIN<br />
tlkpMaritalStatus ON tblPatients.MaritalStatus = tlkpMaritalStatus.StatusNumber ON tlkpOutPhysicians.PatientPhysicianNumber = tblPatients.PatientPhysician LEFT OUTER JOIN tlkpOverweightTimeframe ON tblPatients.OverweightTimeframeID =tlkpOverweightTimeframe.OverweightTimeframeID<br />
 LEFT OUTER JOIN tlkpProcedures ON tblPatients.PreferredProcedure = tlkpProcedures.ProcedureNumber <br />
LEFT OUTER JOIN tlkpBWLSStaff ON tblPatients.SurgeonOfChoice = tlkpBWLSStaff.BWLSStaffNumber LEFT OUTER JOIN tlkpReferralSources ON tblPatients.ReputationSource = tlkpReferralSources.ReferralSourceNumber LEFT OUTER JOIN tlkpSurgeonChangeReasons ON tblPatients.ReasonSurgeonChoiceChanged = tlkpSurgeonChangeReasons.SurgeonChangeReasonID<br />
ORDER BY tblPatients.LastName, tblPatients.FirstName, tblPatients.MiddleInitial


I apologize for the mess code. I tried formatting it better with no luck.

Before the error above I was getting complaints about the table name tlkpOutPhysicians saying there was a syntax error around there, never could figure that out. The table is there along with the rest.

Thanks, hope someone can shed some light on it.


Steve Welborn
Software Engineer
Inrange Consulting

AnswerRe: Issue with Select Statement... Pin
Michael Potter17-Sep-07 3:53
Michael Potter17-Sep-07 3:53 
GeneralRe: Issue with Select Statement... Pin
DeepToot17-Sep-07 4:04
DeepToot17-Sep-07 4:04 
GeneralRe: Issue with Select Statement... Pin
andyharman17-Sep-07 4:25
professionalandyharman17-Sep-07 4:25 
GeneralRe: Issue with Select Statement... Pin
DeepToot17-Sep-07 4:35
DeepToot17-Sep-07 4:35 
GeneralGot it.. Pin
DeepToot17-Sep-07 4:36
DeepToot17-Sep-07 4:36 
GeneralRe: Issue with Select Statement... Pin
Michael Potter17-Sep-07 4:38
Michael Potter17-Sep-07 4:38 
GeneralRe: Issue with Select Statement... Pin
DeepToot17-Sep-07 5:07
DeepToot17-Sep-07 5:07 
QuestionDeleting record from a parent table Pin
anujose17-Sep-07 2:13
anujose17-Sep-07 2:13 
AnswerRe: Deleting record from a parent table Pin
Colin Angus Mackay17-Sep-07 2:20
Colin Angus Mackay17-Sep-07 2:20 
AnswerRe: Deleting record from a parent table Pin
Pete O'Hanlon17-Sep-07 2:22
mvePete O'Hanlon17-Sep-07 2:22 
GeneralRe: Deleting record from a parent table Pin
anujose17-Sep-07 2:38
anujose17-Sep-07 2:38 
GeneralRe: Deleting record from a parent table Pin
Pete O'Hanlon17-Sep-07 2:44
mvePete O'Hanlon17-Sep-07 2:44 
QuestionDistinct statement Pin
udikantz17-Sep-07 1:56
udikantz17-Sep-07 1:56 
AnswerRe: Distinct statement Pin
Colin Angus Mackay17-Sep-07 2:26
Colin Angus Mackay17-Sep-07 2:26 
GeneralRe: Distinct statement Pin
udikantz17-Sep-07 3:07
udikantz17-Sep-07 3:07 
GeneralRe: Distinct statement Pin
Colin Angus Mackay17-Sep-07 3:12
Colin Angus Mackay17-Sep-07 3:12 
QuestionMultiLine Cell in DataGridView Pin
udikantz16-Sep-07 23:47
udikantz16-Sep-07 23:47 
AnswerRe: MultiLine Cell in DataGridView Pin
Frank Kerrigan18-Sep-07 2:42
Frank Kerrigan18-Sep-07 2:42 
QuestionOrder by Pin
Sebastian T Xavier16-Sep-07 19:19
Sebastian T Xavier16-Sep-07 19:19 
AnswerRe: Order by Pin
Blue_Boy16-Sep-07 20:36
Blue_Boy16-Sep-07 20:36 
GeneralRe: Order by Pin
Sebastian T Xavier16-Sep-07 20:58
Sebastian T Xavier16-Sep-07 20:58 
GeneralRe: Order by Pin
Colin Angus Mackay16-Sep-07 21:25
Colin Angus Mackay16-Sep-07 21:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.