 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 31st, 2004, 12:49 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
syntax error near '='
Hi everyone
I am getting syntax error near '=' while running this query :
SELECT People.People, People.Name, Sum((ProjectStatusReport.Week),0,((ProjectStatusRe port.Week) = "1/1/2003",1,0))
AS Created, Sum((ProjectStatusReport.Week),0,(ProjectStatusRep ort.Week = "1/1/2004",(ProjectStatusReport.Accomplishments)
Or (ProjectStatusReport.Plans),0,1,0)) AS Complete, People.email FROM Register INNER JOIN SR_Status
ON Register.SR_Status = SR_Status.SR_Status LEFT JOIN ProjectStatusReport ON
Register.Register = ProjectStatusReport.Project INNER JOIN StakeHolders ON Register.Register = StakeHolders.Register
INNER JOIN People ON StakeHolders.People = People.People WHERE SR_Status.Status="Active"
AND StakeHolders.Status = "Yes" GROUP BY People.People, People.Name, People.email
HAVING Sum(ProjectStatusReport.Week),0,(ProjectStatusRepo rt.Week = "1/1/2003",1,0)>0 AND
Sum(ProjectStatusReport.Week),0,((ProjectStatusRep ort.Week) = "1/1/2004",(ProjectStatusReport.Accomplishments)
Or (ProjectStatusReport.Plans),0,1,0)>0 ORDER BY People.People
Can anyone help me
Regards
sinapra
__________________
sinapra
|
|

August 31st, 2004, 01:05 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Could you tel us that on which = there is an error because in this code alot of = signs and one cannot find that where is the error
(*_*)
Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
|
|

August 31st, 2004, 01:10 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
its at the first line,
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '='.
sinapra
|
|

August 31st, 2004, 01:26 AM
|
|
Friend of Wrox
|
|
Join Date: May 2003
Posts: 229
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Just try to replace all the double quotes (") with a single quote ('), if you were not using any ASP variable with in the query string, otherwise use the following syntax
strSQL1 = "SELECT imgurl, unitsale FROM bookstable where title LIKE '%" & keyword & "%' OR publisher LIKE '%" & keyword & "%' AND isbnno is not null AND status NOT LIKE '0' order by status ASC"
Charul Shukla
|
|

August 31st, 2004, 01:37 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
not helping in either way
sinapra
|
|

August 31st, 2004, 02:45 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Try to use this
SELECT People.People, People.Name,
Sum((ProjectStatusReport.Week),0,'(ProjectStatusRe port.Week) = "1/1/2003",1,0)')
(*_*)
Numan
--------------------------------------------------
Love is the most precious thing of this world. So find and grab it!
|
|

August 31st, 2004, 02:50 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Tried, it returned :
The Sum function requires 1 arguments.
Its taking it as single input i believe,
Regards
sinapra
|
|

September 3rd, 2004, 02:53 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Hi sinapra,
= is used in WHERE CLAUSE or in SELECT list only when defining aliases to user defined columns. Also I have never seen SUM function taking so many arguments as you have in there.
Can you explain on what you are trying to do here?
Sum((ProjectStatusReport.Week),0,((ProjectStatusRe port.Week)= "1/1/2003",1,0)) AS Created, Sum((ProjectStatusReport.Week),0,(ProjectStatusRep ort.Week = "1/1/2004",(ProjectStatusReport.Accomplishments)
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| Parse error: syntax error, unexpected T_ELSE in /h |
vipin k varghese |
BOOK: XSLT Programmer's Reference, 2nd Edition |
4 |
September 29th, 2011 01:19 AM |
| Ch 4: Parse error: syntax error, unexpected T_SL |
hanizar77 |
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 |
0 |
June 23rd, 2008 09:17 PM |
| Parse error: syntax error, unexpected T_STRING |
ginost7 |
Beginning PHP |
1 |
November 9th, 2007 02:51 AM |
| VB Error: Syntax Error or Access Violation |
codehappy |
VB How-To |
7 |
October 3rd, 2007 05:41 PM |
| Compile error: Syntax error: & Else without HELP |
Corey |
VB How-To |
2 |
April 21st, 2006 03:25 PM |
|
 |