sql statements

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I Have created a Crime Tracking database. I use this DataBase to track crime.
I enter Daily Crime and then print reports of this data. I have created some
queries that use SQl statements tio create fields so that they can be added
and compare the percentage of crime increase or decrease. The Queries are
pulled from a [Begginning Date] and [Ending Date] as search criteria. I put a
date frame and use that data to analyze crime. I have three fields in My
incidents Table that are logical fields. They are check boxes that tell me if
is there was an arrest made, was it attempted, or complaint. I want to create
a colum so that I can add how many arrest were made how many were complaints
and how many were attempted. I typed the following stament -Sum(Attempted)
AS CountAttempt,-Sum(Arrest) AS CountArrest, -Sum(Complaint) AS
CountComplaint, in SQL but I keep getting an error message. The Message is
(You tried to execute a query that does not include the specific expression
'Enter Beginning Date" As part of an aggregate Funtion. I have use the smae
statement in a simple query and it works but when I put it in a more complex
query I get that error message. You help will be greatly appreciated.
 
Your query is is trying to to a total and you are not using one of the
Aggregate functions (Group By, Sum, Max, etc). It may be necessary to break
this into 2 queries. The main query to filter by begin - end dates and a
subquery to count your indidents.
 
"How To Count Logical Fiels"
I Have created a Crime Tracking database. I use this DataBase to
track crime. I enter Daily Crime and then print reports of this data.
I have created some queries that use SQl statements tio create fields
so that they can be added and compare the percentage of crime
increase or decrease. The Queries are pulled from a [Begginning Date]
and [Ending Date] as search criteria. I put a date frame and use that
data to analyze crime. I have three fields in My incidents Table that
are logical fields. They are check boxes that tell me if is there was
an arrest made, was it attempted, or complaint. I want to create a
colum so that I can add how many arrest were made how many were
complaints and how many were attempted. I typed the following stament
-Sum(Attempted) AS CountAttempt,-Sum(Arrest) AS CountArrest,
-Sum(Complaint) AS CountComplaint, in SQL but I keep getting an
error message. The Message is (You tried to execute a query that does
not include the specific expression 'Enter Beginning Date" As part of
an aggregate Funtion. I have use the smae statement in a simple query
and it works but when I put it in a more complex query I get that
error message. You help will be greatly appreciated.

If youi post the SQL of the query we may be able to figure out where
you're going wrong.
 
Back
Top