Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Unanswered: get the number of reports per day

    I have a table that has a DateTime field that stores something like this "2004/01/19 16:16:15" which lets me know the date and time of the report. Now I need an sql statement that would let me know how many reports are being made per day. Can someone help me out?
    This is what I've been doing(see sql), but I have to change the date and then run the query for a certain date. But I want one query that will give me the count on every date. I hope someone understands what I'm talking about. Thanks.

    select * from Table where
    DateTime >= '2004/03/01' and DateTime < '2004/03/01 23:59:59';

  2. #2
    Join Date
    Jul 2003
    San Antonio, TX
    Replace hard-coded date reference with a function call:

    select * from Table where
    DateTime >= convert(char(10), getdate(), 101)
    and DateTime < dateadd(day, 1, convert(char(10), getdate(), 101))
    "The data in a record depends on the Key to the record, the Whole Key, and
    nothing but the Key, so help me Codd."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts