Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006
    Posts
    28

    Question Unanswered: Reporting on Date/Time field

    I have a database that has a datestamp as a field on a table. I want to count the number of entries into the table on a given day regardless of the time. How can I do this?

    Example

    ProdID Datestamp
    123 02/21/2007 11:57:56
    123 02/21/2007 11:58:05

    I would want to see

    ProdID Date CountofDatestamp
    123 02/21/2007 2

    Currently I am seeing

    ProdID Date CountofDatestamp
    123 02/21/2007 1
    123 02/21/2007 1

    Thanks,

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    check out the format option, you'll end up doint something like (untested)

    DCount("*", "TblName", "Format([Fld_Date_Entered],'dd') = " & Format(Date, "dd"))

    or something like that.

    Currently I am seeing
    What code are you currently working with?
    Last edited by nckdryr; 02-21-07 at 15:00.
    Me.Geek = True

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    fix(anyDatetime) will return the date-only part of the datetime but is cheating.
    the official function is datevalue(anyDatetime)

    ...i haven't bothered checking which one is faster.

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Jan 2006
    Posts
    28
    Thanks. I got it working using the Fix(datestamp). The DateValue(datestamp) wouldn't work.

Posting Permissions

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