navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Count(aaa) Giving Error...

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Count(aaa) Giving Error...
Page: [1]
 
WingMan

 

Posts: 2
Joined: 12/7/2005
Status: offline

 
Count(aaa) Giving Error... - 12/7/2005 15:49:36   
Hey,

This seems to be an easy one, but I have yet to figure it out... more the fact that I am fairly new to FP, SQL and Access.

Okay, so basically I have a page that has a drop-down box that passes along a parameter to 3 seperate queries on the page. The parameter is named D1 (as in drop-down 1 I guess). The parameter is a number (1, 2, 3 or 6). Note, that each query works fine when the parameter is hard coded in (i.e. instead of D1 I put 1).

The first query works fine, and is:

SELECT arena_name
FROM arenas
WHERE (((arenas.arena_id)=::D1::));

The second query is the one the fails, and is:

SELECT [won]+[lost]+[tied] AS GP, Count(sched.win) AS Won, (SELECT Count(sched.win) FROM sched
WHERE (((sched.win)=2) AND ((sched.arena)=::D1::));) AS Lost, (SELECT Count(sched.win) FROM sched
WHERE (((sched.win)=3) AND ((sched.arena)=::D1::));) AS Tied
FROM sched
WHERE (((sched.win)=1) AND ((sched.arena)=::D1::));

The third query works fine, and is:

SELECT sched.date, sched.o_team, sched.o_score, sched.vs, sched.m_score, sched.m_team
FROM sched
WHERE (((sched.arena)=::D1::));

Any direction would be greatly appreciated!

Thanks,
WM
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Count(aaa) Giving Error... - 12/7/2005 16:13:13   
quote:

SELECT [won]+[lost]+[tied] AS GP, Count(sched.win) AS Won, (SELECT Count(sched.win) FROM sched
WHERE (((sched.win)=2) AND ((sched.arena)=::D1::));) AS Lost, (SELECT Count(sched.win) FROM sched
WHERE (((sched.win)=3) AND ((sched.arena)=::D1::));) AS Tied
FROM sched
WHERE (((sched.win)=1) AND ((sched.arena)=::D1::));


That looks a little messy and I personally wouldn't even attempt that (nothing personal just me) :)

What I would consider doing is something like this:

SELECT Count(sched.win) AS myCount WHERE (sched.arena)=::D1:: ORDER BY sched.win

If all you have is 1,2,3, or 6, you should get 4 records back:
Count for sched.win =1
Count for sched.win =2
Count for sched.win =3
Count for sched.win =6

in that order. Seems quite a bit simpler IMO. That help any?

EDIT: Oh yeah, Hi and Welcome to OutFront. :)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to WingMan)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Count(aaa) Giving Error...
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts