Association of Personal Injury Lawyers logo
Association of Personal Injury Lawyers
SELECT ClientDetailsHTML = CASE WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) AND FirmWebsite IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + FirmName + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' ELSE CONVERT(VARCHAR, Tbl_Client.MembershipNo) END, IndividualAccreditationHTML = CASE WHEN CPILType = 'Senior Litigator' THEN '
Personal injury - Senior Litigator
' WHEN CPILType = 'Fellow' THEN '
Personal injury - Fellow
' WHEN CPILType = 'Senior Fellow' THEN '
Personal injury - Senior Fellow
' END, CASE WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 255 THEN LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255 - CHARINDEX(' ', REVERSE(LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255)))) + '... Read more' WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 0 THEN dbo.udf_StripHTML(LawyerSearchBiography) + ' Read more' ELSE '' END AS FormattedLawyerSearchBiography, CASE WHEN LawyerSearchImageFileName IS NOT NULL THEN '' ELSE NULL END AS FormatedLawyerSearchImageFileName, LawyerSearchImageFileName, AccreditedFirmHTML = CASE WHEN FirmAccredited = 1 THEN '
Personal injury legal practice
' END, BrainInjurySpecialistHTML = CASE WHEN Tbl_Client.BrainInjurySpecialistSince IS NOT NULL THEN '
Brain injury lawyer
' END, ClinNegSpecialistHTML = CASE WHEN Tbl_Client.ClinNegSpecialistSince IS NOT NULL THEN '
Clinical negligence lawyer
' END, SpinalCordInjurySpecialistHTML = CASE WHEN Tbl_Client.SpinalInjurySpecialistSince IS NOT NULL THEN '
Spinal cord injury lawyer
' END, OccDiseaseSpecialistHTML = CASE WHEN Tbl_Client.OccDiseaseSpecialistSince IS NOT NULL THEN '
Occupational disease lawyer
' END, AsbestosDiseaseSpecialistHTML = CASE WHEN Tbl_Client.AsbestosDiseaseSpecialistSince IS NOT NULL THEN '
Asbestos disease lawyer
' END, AccidentsAndIllnessesAbroadSpecialistHTML = CASE WHEN Tbl_Client.AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN '
Accidents aborad lawyer
' END, CASE WHEN BrainInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS BrainInjurySpecialist, CASE WHEN ClinNegSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS ClinNegSpecialist, CASE WHEN SpinalInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS SpinalInjurySpecialist, CASE WHEN OccDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS OccDiseaseSpecialist, CASE WHEN AsbestosDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AsbestosDiseaseSpecialist, CASE WHEN AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AccidentsAndIllnessesAbroadSpecialist, ClientCorrespondenceFirstName, ClientCorrespondenceSurname, ClientCorrespondenceTown, FirmName, CASE WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 0 THEN 'Distance: Less than one mile' WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 1 THEN 'Distance: 1 mile' ELSE 'Distance: ' + CONVERT(VARCHAR, ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0)) + ' miles' END AS Distance, CPILType FROM Tbl_Client LEFT OUTER JOIN Tbl_ClientType ON Tbl_Client.ClientID = Tbl_ClientType.ClientID LEFT OUTER JOIN Tbl_ClientCorrespondenceAddress ON Tbl_Client.ClientID = Tbl_ClientCorrespondenceAddress.ClientID LEFT OUTER JOIN Tbl_Firm ON Tbl_ClientCorrespondenceAddress.ClientCorrespondenceFirmID = Tbl_Firm.FirmID LEFT OUTER JOIN Tbl_SIGMembership ON Tbl_ClientCorrespondenceAddress.ClientID = Tbl_SIGMembership.ClientID LEFT OUTER JOIN Tbl_Login ON Tbl_Client.MembershipNo = Tbl_Login.MembershipNo WHERE Tbl_Client.ClientArchive = 0 AND GeographyPoint.STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))<=(10 * 1609.344) AND (Tbl_Client.CPILType = 'Senior Litigator' OR Tbl_Client.CPILType = 'Fellow' OR Tbl_Client.CPILType = 'Senior Fellow' OR (Tbl_Client.CPILType = 'Specialist Counsel' AND BarristerRegisteredForPublicAccess = 1)) AND (ExcludeFromWebsite IS NULL OR ExcludeFromWebsite = 0) AND = 1 AND Tbl_ClientType.ClientType = 'Member' AND ClientCorrespondenceFirstName IS NOT NULL AND Tbl_Client.MembershipNo <> 954 ORDER BY LastViewed ASC, ClientSurname ASC

ERROR: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at injury_lawyers.SearchForLawyers() in d:\Websites\apil.org.uk-nimrod\injury-lawyers.aspx.cs:line 466 ClientConnectionId:9e95cdbc-782b-4af0-9b70-ef6a366e4de9 Error Number:102,State:1,Class:15

SELECT ClientDetailsHTML = CASE WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) AND FirmWebsite IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + FirmName + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' ELSE CONVERT(VARCHAR, Tbl_Client.MembershipNo) END, IndividualAccreditationHTML = CASE WHEN CPILType = 'Senior Litigator' THEN '
Personal injury - Senior Litigator
' WHEN CPILType = 'Fellow' THEN '
Personal injury - Fellow
' WHEN CPILType = 'Senior Fellow' THEN '
Personal injury - Senior Fellow
' END, CASE WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 255 THEN LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255 - CHARINDEX(' ', REVERSE(LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255)))) + '... Read more' WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 0 THEN dbo.udf_StripHTML(LawyerSearchBiography) + ' Read more' ELSE '' END AS FormattedLawyerSearchBiography, CASE WHEN LawyerSearchImageFileName IS NOT NULL THEN '' ELSE NULL END AS FormatedLawyerSearchImageFileName, LawyerSearchImageFileName, AccreditedFirmHTML = CASE WHEN FirmAccredited = 1 THEN '
Personal injury legal practice
' END, BrainInjurySpecialistHTML = CASE WHEN Tbl_Client.BrainInjurySpecialistSince IS NOT NULL THEN '
Brain injury lawyer
' END, ClinNegSpecialistHTML = CASE WHEN Tbl_Client.ClinNegSpecialistSince IS NOT NULL THEN '
Clinical negligence lawyer
' END, SpinalCordInjurySpecialistHTML = CASE WHEN Tbl_Client.SpinalInjurySpecialistSince IS NOT NULL THEN '
Spinal cord injury lawyer
' END, OccDiseaseSpecialistHTML = CASE WHEN Tbl_Client.OccDiseaseSpecialistSince IS NOT NULL THEN '
Occupational disease lawyer
' END, AsbestosDiseaseSpecialistHTML = CASE WHEN Tbl_Client.AsbestosDiseaseSpecialistSince IS NOT NULL THEN '
Asbestos disease lawyer
' END, AccidentsAndIllnessesAbroadSpecialistHTML = CASE WHEN Tbl_Client.AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN '
Accidents aborad lawyer
' END, CASE WHEN BrainInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS BrainInjurySpecialist, CASE WHEN ClinNegSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS ClinNegSpecialist, CASE WHEN SpinalInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS SpinalInjurySpecialist, CASE WHEN OccDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS OccDiseaseSpecialist, CASE WHEN AsbestosDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AsbestosDiseaseSpecialist, CASE WHEN AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AccidentsAndIllnessesAbroadSpecialist, ClientCorrespondenceFirstName, ClientCorrespondenceSurname, ClientCorrespondenceTown, FirmName, CASE WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 0 THEN 'Distance: Less than one mile' WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 1 THEN 'Distance: 1 mile' ELSE 'Distance: ' + CONVERT(VARCHAR, ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0)) + ' miles' END AS Distance, CPILType FROM Tbl_Client LEFT OUTER JOIN Tbl_ClientType ON Tbl_Client.ClientID = Tbl_ClientType.ClientID LEFT OUTER JOIN Tbl_ClientCorrespondenceAddress ON Tbl_Client.ClientID = Tbl_ClientCorrespondenceAddress.ClientID LEFT OUTER JOIN Tbl_Firm ON Tbl_ClientCorrespondenceAddress.ClientCorrespondenceFirmID = Tbl_Firm.FirmID LEFT OUTER JOIN Tbl_SIGMembership ON Tbl_ClientCorrespondenceAddress.ClientID = Tbl_SIGMembership.ClientID LEFT OUTER JOIN Tbl_Login ON Tbl_Client.MembershipNo = Tbl_Login.MembershipNo WHERE Tbl_Client.ClientArchive = 0 AND GeographyPoint.STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))<=(10 * 1609.344) AND (Tbl_Client.CPILType = 'Litigator' OR Tbl_Client.CPILType = 'Senior Litigator' OR Tbl_Client.CPILType = 'Fellow' OR Tbl_Client.CPILType = 'Senior Fellow' OR (Tbl_Client.CPILType = 'Specialist Counsel' AND BarristerRegisteredForPublicAccess = 1)) AND (ExcludeFromWebsite IS NULL OR ExcludeFromWebsite = 0) AND = 1 AND Tbl_ClientType.ClientType = 'Member' AND ClientCorrespondenceFirstName IS NOT NULL AND Tbl_Client.MembershipNo <> 954 ORDER BY LastViewed ASC, ClientSurname ASC

ERROR: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at injury_lawyers.SearchForLawyers() in d:\Websites\apil.org.uk-nimrod\injury-lawyers.aspx.cs:line 466 ClientConnectionId:9e95cdbc-782b-4af0-9b70-ef6a366e4de9 Error Number:102,State:1,Class:15

SELECT ClientDetailsHTML = CASE WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) AND FirmWebsite IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + FirmName + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' ELSE CONVERT(VARCHAR, Tbl_Client.MembershipNo) END, IndividualAccreditationHTML = CASE WHEN CPILType = 'Senior Litigator' THEN '
Personal injury - Senior Litigator
' WHEN CPILType = 'Fellow' THEN '
Personal injury - Fellow
' WHEN CPILType = 'Senior Fellow' THEN '
Personal injury - Senior Fellow
' END, CASE WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 255 THEN LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255 - CHARINDEX(' ', REVERSE(LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255)))) + '... Read more' WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 0 THEN dbo.udf_StripHTML(LawyerSearchBiography) + ' Read more' ELSE '' END AS FormattedLawyerSearchBiography, CASE WHEN LawyerSearchImageFileName IS NOT NULL THEN '' ELSE NULL END AS FormatedLawyerSearchImageFileName, LawyerSearchImageFileName, AccreditedFirmHTML = CASE WHEN FirmAccredited = 1 THEN '
Personal injury legal practice
' END, BrainInjurySpecialistHTML = CASE WHEN Tbl_Client.BrainInjurySpecialistSince IS NOT NULL THEN '
Brain injury lawyer
' END, ClinNegSpecialistHTML = CASE WHEN Tbl_Client.ClinNegSpecialistSince IS NOT NULL THEN '
Clinical negligence lawyer
' END, SpinalCordInjurySpecialistHTML = CASE WHEN Tbl_Client.SpinalInjurySpecialistSince IS NOT NULL THEN '
Spinal cord injury lawyer
' END, OccDiseaseSpecialistHTML = CASE WHEN Tbl_Client.OccDiseaseSpecialistSince IS NOT NULL THEN '
Occupational disease lawyer
' END, AsbestosDiseaseSpecialistHTML = CASE WHEN Tbl_Client.AsbestosDiseaseSpecialistSince IS NOT NULL THEN '
Asbestos disease lawyer
' END, AccidentsAndIllnessesAbroadSpecialistHTML = CASE WHEN Tbl_Client.AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN '
Accidents aborad lawyer
' END, CASE WHEN BrainInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS BrainInjurySpecialist, CASE WHEN ClinNegSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS ClinNegSpecialist, CASE WHEN SpinalInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS SpinalInjurySpecialist, CASE WHEN OccDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS OccDiseaseSpecialist, CASE WHEN AsbestosDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AsbestosDiseaseSpecialist, CASE WHEN AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AccidentsAndIllnessesAbroadSpecialist, ClientCorrespondenceFirstName, ClientCorrespondenceSurname, ClientCorrespondenceTown, FirmName, CASE WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 0 THEN 'Distance: Less than one mile' WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 1 THEN 'Distance: 1 mile' ELSE 'Distance: ' + CONVERT(VARCHAR, ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0)) + ' miles' END AS Distance, CPILType FROM Tbl_Client LEFT OUTER JOIN Tbl_ClientType ON Tbl_Client.ClientID = Tbl_ClientType.ClientID LEFT OUTER JOIN Tbl_ClientCorrespondenceAddress ON Tbl_Client.ClientID = Tbl_ClientCorrespondenceAddress.ClientID LEFT OUTER JOIN Tbl_Firm ON Tbl_ClientCorrespondenceAddress.ClientCorrespondenceFirmID = Tbl_Firm.FirmID LEFT OUTER JOIN Tbl_SIGMembership ON Tbl_ClientCorrespondenceAddress.ClientID = Tbl_SIGMembership.ClientID LEFT OUTER JOIN Tbl_Login ON Tbl_Client.MembershipNo = Tbl_Login.MembershipNo WHERE Tbl_Client.ClientArchive = 0 AND GeographyPoint.STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))<=(25 * 1609.344) AND (Tbl_Client.CPILType = 'Litigator' OR Tbl_Client.CPILType = 'Senior Litigator' OR Tbl_Client.CPILType = 'Fellow' OR Tbl_Client.CPILType = 'Senior Fellow' OR (Tbl_Client.CPILType = 'Specialist Counsel' AND BarristerRegisteredForPublicAccess = 1)) AND (ExcludeFromWebsite IS NULL OR ExcludeFromWebsite = 0) AND = 1 AND Tbl_ClientType.ClientType = 'Member' AND ClientCorrespondenceFirstName IS NOT NULL AND Tbl_Client.MembershipNo <> 954 ORDER BY LastViewed ASC, ClientSurname ASC

ERROR: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at injury_lawyers.SearchForLawyers() in d:\Websites\apil.org.uk-nimrod\injury-lawyers.aspx.cs:line 466 ClientConnectionId:9e95cdbc-782b-4af0-9b70-ef6a366e4de9 Error Number:102,State:1,Class:15

SELECT ClientDetailsHTML = CASE WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) AND FirmWebsite IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + FirmName + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' ELSE CONVERT(VARCHAR, Tbl_Client.MembershipNo) END, IndividualAccreditationHTML = CASE WHEN CPILType = 'Senior Litigator' THEN '
Personal injury - Senior Litigator
' WHEN CPILType = 'Fellow' THEN '
Personal injury - Fellow
' WHEN CPILType = 'Senior Fellow' THEN '
Personal injury - Senior Fellow
' END, CASE WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 255 THEN LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255 - CHARINDEX(' ', REVERSE(LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255)))) + '... Read more' WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 0 THEN dbo.udf_StripHTML(LawyerSearchBiography) + ' Read more' ELSE '' END AS FormattedLawyerSearchBiography, CASE WHEN LawyerSearchImageFileName IS NOT NULL THEN '' ELSE NULL END AS FormatedLawyerSearchImageFileName, LawyerSearchImageFileName, AccreditedFirmHTML = CASE WHEN FirmAccredited = 1 THEN '
Personal injury legal practice
' END, BrainInjurySpecialistHTML = CASE WHEN Tbl_Client.BrainInjurySpecialistSince IS NOT NULL THEN '
Brain injury lawyer
' END, ClinNegSpecialistHTML = CASE WHEN Tbl_Client.ClinNegSpecialistSince IS NOT NULL THEN '
Clinical negligence lawyer
' END, SpinalCordInjurySpecialistHTML = CASE WHEN Tbl_Client.SpinalInjurySpecialistSince IS NOT NULL THEN '
Spinal cord injury lawyer
' END, OccDiseaseSpecialistHTML = CASE WHEN Tbl_Client.OccDiseaseSpecialistSince IS NOT NULL THEN '
Occupational disease lawyer
' END, AsbestosDiseaseSpecialistHTML = CASE WHEN Tbl_Client.AsbestosDiseaseSpecialistSince IS NOT NULL THEN '
Asbestos disease lawyer
' END, AccidentsAndIllnessesAbroadSpecialistHTML = CASE WHEN Tbl_Client.AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN '
Accidents aborad lawyer
' END, CASE WHEN BrainInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS BrainInjurySpecialist, CASE WHEN ClinNegSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS ClinNegSpecialist, CASE WHEN SpinalInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS SpinalInjurySpecialist, CASE WHEN OccDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS OccDiseaseSpecialist, CASE WHEN AsbestosDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AsbestosDiseaseSpecialist, CASE WHEN AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AccidentsAndIllnessesAbroadSpecialist, ClientCorrespondenceFirstName, ClientCorrespondenceSurname, ClientCorrespondenceTown, FirmName, CASE WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 0 THEN 'Distance: Less than one mile' WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 1 THEN 'Distance: 1 mile' ELSE 'Distance: ' + CONVERT(VARCHAR, ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0)) + ' miles' END AS Distance, CPILType FROM Tbl_Client LEFT OUTER JOIN Tbl_ClientType ON Tbl_Client.ClientID = Tbl_ClientType.ClientID LEFT OUTER JOIN Tbl_ClientCorrespondenceAddress ON Tbl_Client.ClientID = Tbl_ClientCorrespondenceAddress.ClientID LEFT OUTER JOIN Tbl_Firm ON Tbl_ClientCorrespondenceAddress.ClientCorrespondenceFirmID = Tbl_Firm.FirmID LEFT OUTER JOIN Tbl_SIGMembership ON Tbl_ClientCorrespondenceAddress.ClientID = Tbl_SIGMembership.ClientID LEFT OUTER JOIN Tbl_Login ON Tbl_Client.MembershipNo = Tbl_Login.MembershipNo WHERE Tbl_Client.ClientArchive = 0 AND GeographyPoint.STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))<=(50 * 1609.344) AND (Tbl_Client.CPILType = 'Litigator' OR Tbl_Client.CPILType = 'Senior Litigator' OR Tbl_Client.CPILType = 'Fellow' OR Tbl_Client.CPILType = 'Senior Fellow' OR (Tbl_Client.CPILType = 'Specialist Counsel' AND BarristerRegisteredForPublicAccess = 1)) AND (ExcludeFromWebsite IS NULL OR ExcludeFromWebsite = 0) AND = 1 AND Tbl_ClientType.ClientType = 'Member' AND ClientCorrespondenceFirstName IS NOT NULL AND Tbl_Client.MembershipNo <> 954 ORDER BY LastViewed ASC, ClientSurname ASC

ERROR: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at injury_lawyers.SearchForLawyers() in d:\Websites\apil.org.uk-nimrod\injury-lawyers.aspx.cs:line 466 ClientConnectionId:9e95cdbc-782b-4af0-9b70-ef6a366e4de9 Error Number:102,State:1,Class:15

SELECT ClientDetailsHTML = CASE WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) AND FirmWebsite IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + FirmName + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' ELSE CONVERT(VARCHAR, Tbl_Client.MembershipNo) END, IndividualAccreditationHTML = CASE WHEN CPILType = 'Senior Litigator' THEN '
Personal injury - Senior Litigator
' WHEN CPILType = 'Fellow' THEN '
Personal injury - Fellow
' WHEN CPILType = 'Senior Fellow' THEN '
Personal injury - Senior Fellow
' END, CASE WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 255 THEN LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255 - CHARINDEX(' ', REVERSE(LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255)))) + '... Read more' WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 0 THEN dbo.udf_StripHTML(LawyerSearchBiography) + ' Read more' ELSE '' END AS FormattedLawyerSearchBiography, CASE WHEN LawyerSearchImageFileName IS NOT NULL THEN '' ELSE NULL END AS FormatedLawyerSearchImageFileName, LawyerSearchImageFileName, AccreditedFirmHTML = CASE WHEN FirmAccredited = 1 THEN '
Personal injury legal practice
' END, BrainInjurySpecialistHTML = CASE WHEN Tbl_Client.BrainInjurySpecialistSince IS NOT NULL THEN '
Brain injury lawyer
' END, ClinNegSpecialistHTML = CASE WHEN Tbl_Client.ClinNegSpecialistSince IS NOT NULL THEN '
Clinical negligence lawyer
' END, SpinalCordInjurySpecialistHTML = CASE WHEN Tbl_Client.SpinalInjurySpecialistSince IS NOT NULL THEN '
Spinal cord injury lawyer
' END, OccDiseaseSpecialistHTML = CASE WHEN Tbl_Client.OccDiseaseSpecialistSince IS NOT NULL THEN '
Occupational disease lawyer
' END, AsbestosDiseaseSpecialistHTML = CASE WHEN Tbl_Client.AsbestosDiseaseSpecialistSince IS NOT NULL THEN '
Asbestos disease lawyer
' END, AccidentsAndIllnessesAbroadSpecialistHTML = CASE WHEN Tbl_Client.AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN '
Accidents aborad lawyer
' END, CASE WHEN BrainInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS BrainInjurySpecialist, CASE WHEN ClinNegSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS ClinNegSpecialist, CASE WHEN SpinalInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS SpinalInjurySpecialist, CASE WHEN OccDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS OccDiseaseSpecialist, CASE WHEN AsbestosDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AsbestosDiseaseSpecialist, CASE WHEN AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AccidentsAndIllnessesAbroadSpecialist, ClientCorrespondenceFirstName, ClientCorrespondenceSurname, ClientCorrespondenceTown, FirmName, CASE WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 0 THEN 'Distance: Less than one mile' WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 1 THEN 'Distance: 1 mile' ELSE 'Distance: ' + CONVERT(VARCHAR, ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0)) + ' miles' END AS Distance, CPILType FROM Tbl_Client LEFT OUTER JOIN Tbl_ClientType ON Tbl_Client.ClientID = Tbl_ClientType.ClientID LEFT OUTER JOIN Tbl_ClientCorrespondenceAddress ON Tbl_Client.ClientID = Tbl_ClientCorrespondenceAddress.ClientID LEFT OUTER JOIN Tbl_Firm ON Tbl_ClientCorrespondenceAddress.ClientCorrespondenceFirmID = Tbl_Firm.FirmID LEFT OUTER JOIN Tbl_SIGMembership ON Tbl_ClientCorrespondenceAddress.ClientID = Tbl_SIGMembership.ClientID LEFT OUTER JOIN Tbl_Login ON Tbl_Client.MembershipNo = Tbl_Login.MembershipNo WHERE Tbl_Client.ClientArchive = 0 AND GeographyPoint.STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))<=(100 * 1609.344) AND (Tbl_Client.CPILType = 'Litigator' OR Tbl_Client.CPILType = 'Senior Litigator' OR Tbl_Client.CPILType = 'Fellow' OR Tbl_Client.CPILType = 'Senior Fellow' OR (Tbl_Client.CPILType = 'Specialist Counsel' AND BarristerRegisteredForPublicAccess = 1)) AND (ExcludeFromWebsite IS NULL OR ExcludeFromWebsite = 0) AND = 1 AND Tbl_ClientType.ClientType = 'Member' AND ClientCorrespondenceFirstName IS NOT NULL AND Tbl_Client.MembershipNo <> 954 ORDER BY LastViewed ASC, ClientSurname ASC

ERROR: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at injury_lawyers.SearchForLawyers() in d:\Websites\apil.org.uk-nimrod\injury-lawyers.aspx.cs:line 466 ClientConnectionId:9e95cdbc-782b-4af0-9b70-ef6a366e4de9 Error Number:102,State:1,Class:15

SELECT ClientDetailsHTML = CASE WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) AND FirmWebsite IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + FirmName + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL OR FirmAccredited = 1) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NOT NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' of ' + ISNULL(FirmName, '') + ' in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL AND (Tbl_Client.BrainInjurySpecialistSince IS NOT NULL OR Tbl_Client.ClinNegSpecialistSince IS NOT NULL) THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' WHEN FirmName IS NULL THEN '' + ISNULL(ClientCorrespondenceTitle, '') + ' ' + ISNULL(ClientCorrespondenceFirstName, '') + ' ' + ISNULL(ClientCorrespondenceSurname, '') + ' based in ' + ISNULL(ClientCorrespondenceTown, 'UK') + ' ' ELSE CONVERT(VARCHAR, Tbl_Client.MembershipNo) END, IndividualAccreditationHTML = CASE WHEN CPILType = 'Senior Litigator' THEN '
Personal injury - Senior Litigator
' WHEN CPILType = 'Fellow' THEN '
Personal injury - Fellow
' WHEN CPILType = 'Senior Fellow' THEN '
Personal injury - Senior Fellow
' END, CASE WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 255 THEN LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255 - CHARINDEX(' ', REVERSE(LEFT(dbo.udf_StripHTML(LawyerSearchBiography), 255)))) + '... Read more' WHEN LEN(dbo.udf_StripHTML(LawyerSearchBiography)) > 0 THEN dbo.udf_StripHTML(LawyerSearchBiography) + ' Read more' ELSE '' END AS FormattedLawyerSearchBiography, CASE WHEN LawyerSearchImageFileName IS NOT NULL THEN '' ELSE NULL END AS FormatedLawyerSearchImageFileName, LawyerSearchImageFileName, AccreditedFirmHTML = CASE WHEN FirmAccredited = 1 THEN '
Personal injury legal practice
' END, BrainInjurySpecialistHTML = CASE WHEN Tbl_Client.BrainInjurySpecialistSince IS NOT NULL THEN '
Brain injury lawyer
' END, ClinNegSpecialistHTML = CASE WHEN Tbl_Client.ClinNegSpecialistSince IS NOT NULL THEN '
Clinical negligence lawyer
' END, SpinalCordInjurySpecialistHTML = CASE WHEN Tbl_Client.SpinalInjurySpecialistSince IS NOT NULL THEN '
Spinal cord injury lawyer
' END, OccDiseaseSpecialistHTML = CASE WHEN Tbl_Client.OccDiseaseSpecialistSince IS NOT NULL THEN '
Occupational disease lawyer
' END, AsbestosDiseaseSpecialistHTML = CASE WHEN Tbl_Client.AsbestosDiseaseSpecialistSince IS NOT NULL THEN '
Asbestos disease lawyer
' END, AccidentsAndIllnessesAbroadSpecialistHTML = CASE WHEN Tbl_Client.AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN '
Accidents aborad lawyer
' END, CASE WHEN BrainInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS BrainInjurySpecialist, CASE WHEN ClinNegSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS ClinNegSpecialist, CASE WHEN SpinalInjurySpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS SpinalInjurySpecialist, CASE WHEN OccDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS OccDiseaseSpecialist, CASE WHEN AsbestosDiseaseSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AsbestosDiseaseSpecialist, CASE WHEN AccidentsAndIllnessesAbroadSpecialistSince IS NOT NULL THEN 1 ELSE 0 END AS AccidentsAndIllnessesAbroadSpecialist, ClientCorrespondenceFirstName, ClientCorrespondenceSurname, ClientCorrespondenceTown, FirmName, CASE WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 0 THEN 'Distance: Less than one mile' WHEN ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0) = 1 THEN 'Distance: 1 mile' ELSE 'Distance: ' + CONVERT(VARCHAR, ROUND([GeographyPoint].STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))/1609.344, 0)) + ' miles' END AS Distance, CPILType FROM Tbl_Client LEFT OUTER JOIN Tbl_ClientType ON Tbl_Client.ClientID = Tbl_ClientType.ClientID LEFT OUTER JOIN Tbl_ClientCorrespondenceAddress ON Tbl_Client.ClientID = Tbl_ClientCorrespondenceAddress.ClientID LEFT OUTER JOIN Tbl_Firm ON Tbl_ClientCorrespondenceAddress.ClientCorrespondenceFirmID = Tbl_Firm.FirmID LEFT OUTER JOIN Tbl_SIGMembership ON Tbl_ClientCorrespondenceAddress.ClientID = Tbl_SIGMembership.ClientID LEFT OUTER JOIN Tbl_Login ON Tbl_Client.MembershipNo = Tbl_Login.MembershipNo WHERE Tbl_Client.ClientArchive = 0 AND GeographyPoint.STDistance(geography::STGeomFromText('POINT(52.406822 -1.519693)', 4326))<=(1500 * 1609.344) AND (Tbl_Client.CPILType = 'Litigator' OR Tbl_Client.CPILType = 'Senior Litigator' OR Tbl_Client.CPILType = 'Fellow' OR Tbl_Client.CPILType = 'Senior Fellow' OR (Tbl_Client.CPILType = 'Specialist Counsel' AND BarristerRegisteredForPublicAccess = 1)) AND (ExcludeFromWebsite IS NULL OR ExcludeFromWebsite = 0) AND = 1 AND Tbl_ClientType.ClientType = 'Member' AND ClientCorrespondenceFirstName IS NOT NULL AND Tbl_Client.MembershipNo <> 954 ORDER BY LastViewed ASC, ClientSurname ASC

ERROR: System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near '='. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable) at injury_lawyers.SearchForLawyers() in d:\Websites\apil.org.uk-nimrod\injury-lawyers.aspx.cs:line 466 ClientConnectionId:9e95cdbc-782b-4af0-9b70-ef6a366e4de9 Error Number:102,State:1,Class:15

- coventry

Search for a lawyer
Distance
We could not find any lawyers specialising in the this type of claim. Please contact the APIL office for further assistance. Tel 0115 943 5400