Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2009
    Posts
    24

    Unanswered: Unique dcount expression help...

    How can I limit a dcount expression date range to a specific EndDate time (ie 8:00:00AM)?

    Example form inputs:
    txtStartDate = 10/16/2009 6:00:00 AM
    txtEndDate = 10/16/2009 5:00:00 PM

    Current report field (dcounts the entire datetime range above):
    =DCount("[Order Number]","qryTotal_Orders","[Order Date] Between #" & [Forms]![frmShipments]![txtStartDate] & "# And #" & [Forms]![frmShipments]![txtEndDate] & "#")

    Need answer:
    I would like to create a second report field using the same dcount expression, but only dcount until the txtEndDate of 8:00:00 AM no matter what time was actually was entered. What syntax do I need to add to a copy of the above dcount expression?

  2. #2
    Join Date
    Oct 2009
    Posts
    340
    first create a query that results in just the records that satisfy your date range

    then set up the DCount onto that query

  3. #3
    Join Date
    Oct 2009
    Posts
    24
    NTC - I'm not sure how to limit the query to not show anything over 8:00:00 for any given date. Not sure of the syntax... format (date ... etc.

  4. #4
    Join Date
    Oct 2009
    Posts
    340
    not sure I fully understand what you want

    <Date() &" 8:00:00 AM"

    should result in any record before today at 8:00 (which means every record before today)

    <* &" 8:00:00 AM"

    should result in all records less than 8:00 regardless of date...though untested and I'm actually not sure this works...try it though....

Posting Permissions

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