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.
Author |
Topic |
rc1138
Starting Member
35 Posts |
Posted - 2010-05-24 : 21:51:13
|
Guys,Trying to formulate an SQL query to count the number of activities within a month or day (Weekday) without using case when or pivot but so far has been unsuccessfullSELECT COUNT(MONTH(irActivity.ActivityDate)) AS 'JAN', COUNT(MONTH(irIncident.IncDate)) AS 'FEB' FROM irActivity INNER JOINpdEmployee ON irActivity.Comp = pdEmployee.CompOrder By 'JAN'This is where I'm receiving the error - I'm trying to put a filter in this section of the query"COUNT(MONTH(irActivity.ActivityDate) = '1') ""Syntax error close to ="Any help would be greatly appreciated! |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2010-05-24 : 23:44:43
|
Why is it important not to use a CASE statement?CODO ERGO SUM |
|
|
zstarsales04
Starting Member
20 Posts |
Posted - 2010-05-25 : 02:17:39
|
spam removed |
|
|
rc1138
Starting Member
35 Posts |
Posted - 2010-05-25 : 05:43:27
|
Hi Michael,Can't really use a Case statement due to a driver |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2010-05-25 : 07:05:56
|
Which driver are you using? Is this for Microsoft SQL Server or another product? |
|
|
rc1138
Starting Member
35 Posts |
Posted - 2010-05-25 : 21:43:52
|
its for Relativity ODBC driver |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2010-05-25 : 22:01:58
|
You should consult the documentation for the DBMS you are using.This is a Microsoft SQL Server forum, and the TSQL syntax that SQL Server uses will probably not be supported by "Relativity".CODO ERGO SUM |
|
|
|
|
|