Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2006
    Posts
    8

    Unanswered: Help please with calculation

    I need help Please. I have a table that have dates on it example:

    Col 1 Col 2
    Jan 1 1
    Jan 2 2
    Jan 3 3
    Jan 4 4

    In the first form I have the user pick the start date (Jan1) and end date (Jan2). In the next form I need a text box that gives the the result of the Col 2 added together (10).

    Thanks for the help in advance.

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Assuming the date fields are Date/Time data type, use a DSum on the number field with the BETWEEN operator on the date field in the Where clause.

    As always, one of several ways.

    tc

  3. #3
    Join Date
    Jul 2006
    Posts
    8
    Thanks for the help with this. Just one thing I am not advanced enough to understand what you said could you posable show me in a code example or something.

    Thanks in advance

  4. #4
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    YourResult = DSum("[Col2]","[TheTable]","[Col1] Between #" & Me.txtStartDate & "# And #" & Me.txtEndDate & "#")

  5. #5
    Join Date
    Jul 2006
    Posts
    8
    very cool thanks that worked.

Posting Permissions

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