Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Msg 156 Level 15 i get a syntax Error near Groupby

Author  Topic 

shireen
Starting Member

7 Posts

Posted - 2009-07-14 : 00:34:24
select
CONVERT(char(10),wmx_Datetime, 101) as Date ,
sum(round(wmx_dl_traffic_bytes/(1048576),0)) as [DL Mbytes],
sum(round(wmx_qam16_dl_traffic_bytes/(1048576),0)) as [DL Qam16 Mbytes],
sum(round(wmx_qam64_dl_traffic_bytes/(1048576),0)) as [DL Qam64 Mbytes],
sum(round(wmx_qpsk_dl_traffic_bytes/(1048576),0)) as [DL Qpsk Mbytes],
sum(round(wmx_ul_traffic_bytes/(1048576),0)) as [UL Mbytes],
sum(round(wmx_qam16_ul_traffic_bytes/(1048576),0)) as [UL Qam16 Mbytes],
sum(round(wmx_qpsk_ul_traffic_bytes/(1048576),0)) as [UL Qpsk Mbytes],
round(avg((wmx_dl_slot_utilization)),2) as [DL Slot Utilization %],
round(avg((wmx_ul_slot_utilization)),2) as [UL Slot Utilization %],
sum(wmx_no_of_initial_ranging_requests) as [Initial Ranging Requests],
round(sum((wmx_initial_ranging_success_percentage/100*wmx_no_of_initial_ranging_requests)),0) as [Successful Requests],
sum(wmx_no_of_simultaneous_users) as [Maximum Simultaneous Users],
sum(wmx_no_of_attach_setup_requests) as [Attach Setup Requests],
sum(wmx_no_of_successful_attach_setup_requests) as [Successful Attach Setup Requests]

from
(
Select
SiteCodeView.wmx_wac_sector_id,
AlcStatsKhi.wmx_datetime,
AlcStatskhi.wmx_vendor_sector_name,
AlcStatskhi.wmx_dl_traffic_bytes,
AlcStatskhi.wmx_qam16_dl_traffic_bytes,
AlcStatskhi.wmx_qam64_dl_traffic_bytes,
AlcStatskhi.wmx_qpsk_dl_traffic_bytes,
AlcStatskhi.wmx_ul_traffic_bytes,
AlcStatskhi.wmx_qam16_ul_traffic_bytes,
AlcStatskhi. wmx_qpsk_ul_traffic_bytes,
AlcStatskhi.wmx_dl_slot_utilization,
AlcStatskhi.wmx_ul_slot_utilization,
AlcStatskhi.wmx_no_of_initial_ranging_requests,
AlcStatskhi.wmx_initial_ranging_success_percentage,
AlcStatskhi.wmx_no_of_simultaneous_users,
AlcStatskhi.wmx_no_of_attach_setup_requests,
AlcStatskhi.wmx_no_of_successful_attach_setup_requests
from
SiteCodeView,AlcStatsKhi
where
SiteCodeView.wmx_vendor_sector_name=AlcStatskhi.wmx_vendor_sector_name
and
SiteCodeView.wmx_wac_sector_id='103'
and
AlcstatsKhi.wmx_datetime>='7/01/2009 12:00:00 AM'
and
AlcStatsKhi.wmx_datetime<='07/07/2009 12:00:00 PM'
)


group by CONVERT(char(10),wmx_Datetime, 101)

Syntax error near group by cant understand

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-14 : 00:46:09
you need to name the derive table

and
AlcStatsKhi.wmx_datetime<='07/07/2009 12:00:00 PM'
) d
group by CONVERT(char(10),wmx_Datetime, 101)



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-14 : 13:03:33
unless fields like wmx_qpsk_ul_traffic_bytes are of any other type other than int or longint, you dont need the round part as it will automatically do rounding
Go to Top of Page
   

- Advertisement -