one additional possibility..

count the number of each date
select date_column_name, count(*) from table-reference
group by date_column_name

Charles

On Mon, Aug 8, 2016 at 12:32 PM, CRPence <crpbottle@xxxxxxxxx> wrote:

On 08-Aug-2016 11:03 -0500, Steinmetz, Paul wrote:

I'm looking for the syntax to count all records of any date in a
file. Output to a report.


Perhaps some sample data [NULL values included, if relevant] and the
expected output per that data given as input, and then the DDL for the
file(s) whence the data is selected, would elucidate what seems like a very
ambiguous scenario.

And what is meant by a /report/ also needs clarification, minimally for
what /reporting tool/ is being used; typically a question about how to
formulate a SQL query is resolved by presentation of a particular SELECT
statement for which the expected result-set is produced; i.e. the
/reporting/ is usually [client or server] tooling, into which that query is
the input, and often is an entirely separate topic of discussion that the
query itself.

The most simplistic answer for the syntax of such a query, would be to
obtain a count of all rows *irrespective of any date values* in the file:

select count(*) from table-reference

Slightly different, is to provide a count of all non-NULL date values
for a particular date-column:

select count(date_column_name) from table-reference

Slightly different, is to provide a count of all distinct non-NULL date
values for a particular date-column:

select count(DISTINCT date_column_name) from table-reference

Slightly different, is to provide a count of all rows for a particular
date-value of the date-column:

select count(*) from table-reference
where date_column_name = date'… ' /* replace … with date literal */

--
Regards, Chuck


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.