![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have this code and am getting an error near group. I do not see anything can someone else's eyes locate the problem; select [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name] AS [Consumer Namr], [tblhealth_plan].[health_plan_desc] from [tblparticipating_entity],[tblperson],[tblhealth_plan],[tblcoverage_eligibil ity],[tblevent] where [tblcoverage_eligibility].[coverage_end_date] = null AND [tblparticipating_entity].[entity_type_code] = 'c' AND (month([tblevent].[begin_datetime]) & "/" & day([tblevent].[begin_datetime]) & "/" & year([tblevent].[begin_datetime])=getdate() + 1 and [tblhealth_plan].[health_plan_sysid] = '19' or [tblhealth_plan].[health_plan_sysid] = '18' or [tblhealth_plan].[health_plan_sysid] = '115' or [tblhealth_plan].[health_plan_sysid] = '324' group by [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name], [tblhearlth_plan].[health_plan_desc] order by [tblparticipating_entity].[entity_id] Thanks. |
#3
| |||
| |||
|
|
Against what is this query? SQL Server will barf at the & Server: Msg 403, Level 16, State 1, Line 1 Invalid operator for data type. Operator equals boolean AND, type equals varchar. You also use an equality operator against null when it should be IS NULL The " will not be smiled upon necessarily either "seeker53" <seeker53 (AT) discussions (DOT) microsoft.com> wrote in message news:seeker53 (AT) discussions (DOT) microsoft.com: I have this code and am getting an error near group. I do not see anything can someone else's eyes locate the problem; select [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name] AS [Consumer Namr], [tblhealth_plan].[health_plan_desc] from [tblparticipating_entity],[tblperson],[tblhealth_plan],[tblcoverage_eligibil ity],[tblevent] where [tblcoverage_eligibility].[coverage_end_date] = null AND [tblparticipating_entity].[entity_type_code] = 'c' AND (month([tblevent].[begin_datetime]) & "/" & day([tblevent].[begin_datetime]) & "/" & year([tblevent].[begin_datetime])=getdate() + 1 and [tblhealth_plan].[health_plan_sysid] = '19' or [tblhealth_plan].[health_plan_sysid] = '18' or [tblhealth_plan].[health_plan_sysid] = '115' or [tblhealth_plan].[health_plan_sysid] = '324' group by [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name], [tblhearlth_plan].[health_plan_desc] order by [tblparticipating_entity].[entity_id] Thanks. |
#4
| |||
| |||
|
|
I made the following changes and still the same error. I am working in sql server. select [tblparticipating_entity].[entity_id], [tblperson].[first_name] + char(32) + [tblperson].[last_name] AS [Consumer Name], [tblhealth_plan].[health_plan_desc] from [tblparticipating_entity],[tblperson],[tblhealth_plan],[tblcoverage_eligibil ity],[tblevent] where [tblcoverage_eligibility].[coverage_end_date] is null AND [tblparticipating_entity].[entity_type_code] = 'c' AND (month([tblevent].[begin_datetime]) + char(47) + day([tblevent].[begin_datetime]) + char(47) + year([tblevent].[begin_datetime])=getdate() + 1 and [tblhealth_plan].[health_plan_sysid] = '19' or [tblhealth_plan].[health_plan_sysid] = '18' or [tblhealth_plan].[health_plan_sysid] = '115' or [tblhealth_plan].[health_plan_sysid] = '324' group by [tblparticipating_entity].[entity_id], [tblperson].[first_name] & char(32) & [tblperson].[last_name], [tblhearlth_plan].[health_plan_desc] order by [tblparticipating_entity].[entity_id] "Allan Mitchell" wrote: Against what is this query? SQL Server will barf at the & Server: Msg 403, Level 16, State 1, Line 1 Invalid operator for data type. Operator equals boolean AND, type equals varchar. You also use an equality operator against null when it should be IS NULL The " will not be smiled upon necessarily either "seeker53" <seeker53 (AT) discussions (DOT) microsoft.com> wrote in message news:seeker53 (AT) discussions (DOT) microsoft.com: I have this code and am getting an error near group. I do not see anything can someone else's eyes locate the problem; select [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name] AS [Consumer Namr], [tblhealth_plan].[health_plan_desc] from [tblparticipating_entity],[tblperson],[tblhealth_plan],[tblcoverage_eligibil ity],[tblevent] where [tblcoverage_eligibility].[coverage_end_date] = null AND [tblparticipating_entity].[entity_type_code] = 'c' AND (month([tblevent].[begin_datetime]) & "/" & day([tblevent].[begin_datetime]) & "/" & year([tblevent].[begin_datetime])=getdate() + 1 and [tblhealth_plan].[health_plan_sysid] = '19' or [tblhealth_plan].[health_plan_sysid] = '18' or [tblhealth_plan].[health_plan_sysid] = '115' or [tblhealth_plan].[health_plan_sysid] = '324' group by [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name], [tblhearlth_plan].[health_plan_desc] order by [tblparticipating_entity].[entity_id] Thanks. |
#5
| |||
| |||
|
|
I made the following changes and still the same error. I am working in sql server. select [tblparticipating_entity].[entity_id], [tblperson].[first_name] + char(32) + [tblperson].[last_name] AS [Consumer Name], [tblhealth_plan].[health_plan_desc] from [tblparticipating_entity],[tblperson],[tblhealth_plan],[tblcoverage_eligibil ity],[tblevent] where [tblcoverage_eligibility].[coverage_end_date] is null AND [tblparticipating_entity].[entity_type_code] = 'c' AND (month([tblevent].[begin_datetime]) + char(47) + day([tblevent].[begin_datetime]) + char(47) + year([tblevent].[begin_datetime])=getdate() + 1 and [tblhealth_plan].[health_plan_sysid] = '19' or [tblhealth_plan].[health_plan_sysid] = '18' or [tblhealth_plan].[health_plan_sysid] = '115' or [tblhealth_plan].[health_plan_sysid] = '324' group by [tblparticipating_entity].[entity_id], [tblperson].[first_name] & char(32) & [tblperson].[last_name], [tblhearlth_plan].[health_plan_desc] order by [tblparticipating_entity].[entity_id] "Allan Mitchell" wrote: Against what is this query? SQL Server will barf at the & Server: Msg 403, Level 16, State 1, Line 1 Invalid operator for data type. Operator equals boolean AND, type equals varchar. You also use an equality operator against null when it should be IS NULL The " will not be smiled upon necessarily either "seeker53" <seeker53 (AT) discussions (DOT) microsoft.com> wrote in message news:seeker53 (AT) discussions (DOT) microsoft.com: I have this code and am getting an error near group. I do not see anything can someone else's eyes locate the problem; select [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name] AS [Consumer Namr], [tblhealth_plan].[health_plan_desc] from [tblparticipating_entity],[tblperson],[tblhealth_plan],[tblcoverage_eligibil ity],[tblevent] where [tblcoverage_eligibility].[coverage_end_date] = null AND [tblparticipating_entity].[entity_type_code] = 'c' AND (month([tblevent].[begin_datetime]) & "/" & day([tblevent].[begin_datetime]) & "/" & year([tblevent].[begin_datetime])=getdate() + 1 and [tblhealth_plan].[health_plan_sysid] = '19' or [tblhealth_plan].[health_plan_sysid] = '18' or [tblhealth_plan].[health_plan_sysid] = '115' or [tblhealth_plan].[health_plan_sysid] = '324' group by [tblparticipating_entity].[entity_id], [tblperson].[first_name] & " " & [tblperson].[last_name], [tblhearlth_plan].[health_plan_desc] order by [tblparticipating_entity].[entity_id] Thanks. |
![]() |
| Thread Tools | |
| Display Modes | |
| |