dbTalk Databases Forums  

error near group by

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss error near group by in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
seeker53
 
Posts: n/a

Default error near group by - 02-03-2005 , 02:25 PM






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_eligibility],[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.

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: error near group by - 02-03-2005 , 02:54 PM






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

Quote:
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.


Reply With Quote
  #3  
Old   
seeker53
 
Posts: n/a

Default Re: error near group by - 02-03-2005 , 03:03 PM



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_eligibility],[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:

Quote:
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.



Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: error near group by - 02-03-2005 , 03:41 PM



Any chance you could script the table defs?

Might be easier to "read"

Allan

"seeker53" <seeker53 (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.




Reply With Quote
  #5  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: error near group by - 02-03-2005 , 03:43 PM



You also missed an ampersand in the GROUP BY


[tblperson].[first_name] &
char(32) & [tblperson].[last_name],



"seeker53" <seeker53 (AT) discussions (DOT) microsoft.com> wrote

Quote:
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.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.