473,473 Members | 1,906 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

count in select query

8 New Member
I created a database with registration information and my query works well on simply the count of people registered. Instead of count, however, my clients wants number of spaces available (i.e. 10-count)... how do I write that query?

Thanks!!!!!
May 7 '07 #1
5 1989
JConsulting
603 Recognized Expert Contributor
I created a database with registration information and my query works well on simply the count of people registered. Instead of count, however, my clients wants number of spaces available (i.e. 10-count)... how do I write that query?

Thanks!!!!!
Can you post your SQL for your query here?
J
May 7 '07 #2
jslssuze
8 New Member
I created a database with registration information and my query works well on simply the count of people registered. Instead of count, however, my clients wants number of spaces available (i.e. 10-count)... how do I write that query?

Thanks!!!!!
This is what the SQL query looks like now

SELECT DISTINCTROW Count(Results.[Webinars_Computer-Basics]) AS [CountOfWebinars_Computer-Basics], Count(Results.[Webinars_Introduction-to-TASBiller]) AS [CountOfWebinars_Introduction-to-TASBiller], Count(Results.[Webinars_Mystery-Behind-the-Numbers]) AS [CountOfWebinars_Mystery-Behind-the-Numbers], Count(Results.[Webinars_Custom-Invoices]) AS [CountOfWebinars_Custom-Invoices]
FROM Results;
May 7 '07 #3
MMcCarthy
14,534 Recognized Expert Moderator MVP
This is what the SQL query looks like now

SELECT DISTINCTROW Count(Results.[Webinars_Computer-Basics]) AS [CountOfWebinars_Computer-Basics], Count(Results.[Webinars_Introduction-to-TASBiller]) AS [CountOfWebinars_Introduction-to-TASBiller], Count(Results.[Webinars_Mystery-Behind-the-Numbers]) AS [CountOfWebinars_Mystery-Behind-the-Numbers], Count(Results.[Webinars_Custom-Invoices]) AS [CountOfWebinars_Custom-Invoices]
FROM Results;
Just try ...
Expand|Select|Wrap|Line Numbers
  1. SELECT 10 - Count(Results.[Webinars_Computer-Basics]) AS [Webinars_Computer-Basics_Available], 
  2. 10 - Count(Results.[Webinars_Introduction-to-TASBiller]) AS [Webinars_Introduction-to-TASBiller_Available], 
  3. 10 - Count(Results.[Webinars_Mystery-Behind-the-Numbers]) AS [Webinars_Mystery-Behind-the-Numbers_Available], 
  4. 10 - Count(Results.[Webinars_Custom-Invoices]) AS [Webinars_Custom-Invoices_Available]
  5. FROM Results;
May 8 '07 #4
JConsulting
603 Recognized Expert Contributor
Looks good to me. Do you expect to handle any negative numbers?
May 8 '07 #5
jslssuze
8 New Member
Looks good to me. Do you expect to handle any negative numbers?
It worked great! I don't know if there will be negative numbers.. only if someone registers when the numbers are showing 0
May 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: leegold2 | last post by:
Below is some code from a FULLTEXT search. My question is how do I get a count of the number of rows found by the search? $query="SELECT * FROM balloon_txt WHERE MATCH(access_no, recs_txt)...
5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
3
by: Dagpauk | last post by:
Assume the following table holding information about the planning date and execution date for an imaginary "objects" ObjectPlan ObjectID PlannedDate ExecutedDate 1 19.03.04 28.03.04...
3
by: Abhi | last post by:
Hi! I am wondering if this query is possible somehow: I have a table with many fields that all can have a value from 1 to 5. if I wanna see the count of each value from one field, then this...
1
by: sunilkeswani | last post by:
Hi I am still new to access. I want to know how i can build a query which can display results from 4 different columns/fields Like. Field1 Field2 Field3 Field4 1 2 1 ...
0
by: tania | last post by:
i have this table in my database: CREATE TABLE FILM( F_ID INT(5) NOT NULL AUTO_INCREMENT, F_TITLE VARCHAR(40) NOT NULL, DIRECTOR_FNAME VARCHAR(20) NOT NULL, DIRECTOR_LNAME VARCHAR(20) NOT NULL,...
1
by: heckstein | last post by:
I am working in Access 2002 and trying to create a report from our company's learming management system. I am not a DBA and most of my SQL knowledge has been self taught through trial and error. I...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
3
by: Auddog | last post by:
I have the following query that works in mysql: select id, order_no, price, count(item_no), sum(price) from production WHERE item_no = '27714' group by item_no; When I setup my query in php,...
1
by: kummu4help | last post by:
hi, i am using mysql. i have 3 tables with following structures. these are not actual tables i am working on. table A id varchar(16),name varchar(255),InDate datetime table B id...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.