Re: Count Based on Date

From: Allen Browne (AllenBrowne_at_SeeSig.Invalid)
Date: 04/30/04


Date: Fri, 30 Apr 2004 10:29:21 +0800

Works just like that.

HowMany is an alias for the field.
You can use any name you like there (other than reserved words).

Access typically uses:
    SELECT Count([EventID] AS CountOfEventID

If SQL view is new for you, open any query you have and choose SQL View from
the View menu.

-- 
Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Frolickin" <frolickin@NOSPAMhotmail.NOSPAMcom> wrote in message
news:ugV5n9gLEHA.2396@TK2MSFTNGP12.phx.gbl...
> "Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
> news:409081ea$0$16600$5a62ac22@freenews.iinet.net.au...
> > Try a query like this:
> >     SELECT Count([EventID] AS HowMany
> >     FROM [EventTable]
> >     WHERE [EventDate] < #1/1/2004#;
> >
> > (You can type something like that into SQL View of a query).
>
> Thank you for your help.
>
> I am confused by the AS HowMany syntax.  Do I need to define another field
> called "HowMany"?  Where does that field come from?
>
> I appreciate the help,
> Fro.


Relevant Pages

  • RE: number of columns doesnt match bug in Access
    ... The naming of the fields using reserved words could be an source of problems ... Also you use as an alias in the SQL. ... as they must in a Union Join. ... I have a union query which regularily generates the "number of columns ...
    (microsoft.public.access.queries)
  • Re: Execute SQL SELECT statement with VBA code
    ... I need to learn all SQL & ... > other reserved words to avoid. ...
    (microsoft.public.access.formscoding)
  • Re: Execute SQL SELECT statement with VBA code
    ... I'm trying to string several strSQLs together for a custom report query. ... "Sid" wrote in message ... I need to learn all SQL & ... > other reserved words to avoid. ...
    (microsoft.public.access.formscoding)
  • Re: Finding Repeat Complaints
    ... > FROM TableName ... > CountAS HowMany ... > From this query, you get a list of all the types of entries that are ... >>I have over 1000 complaint calls already stored in the database. ...
    (microsoft.public.access.reports)
  • Re: Calculating percentages
    ... Just add the WHERE condition to your query. ... change the HowMany expression as follows: ... > the variable TotalRecords read in ALL, ... >>Include another calculated field which returns the total ...
    (microsoft.public.access.formscoding)