Results 1 to 6 of 6

Thread: DSUM on DATE

  1. #1
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126

    Unanswered: DSUM on DATE

    It's probably simpler problem than I can explain. Imagine I have a report where I display DSUM of a field in a query. That works fine, now I add a date restriction to the query and suddently I start getting error on my report (even though when I run the query, it shows all the date-restricted data). It seems like the DSUM doesn't work with data restriction in a query, it's just my guess. Anybody has any ideas? Thanks

  2. #2
    Join Date
    Nov 2002
    Posts
    150

    Re: DSUM on DATE

    Originally posted by vojtab
    It's probably simpler problem than I can explain. Imagine I have a report where I display DSUM of a field in a query. That works fine, now I add a date restriction to the query and suddently I start getting error on my report (even though when I run the query, it shows all the date-restricted data). It seems like the DSUM doesn't work with data restriction in a query, it's just my guess. Anybody has any ideas? Thanks
    Maybe if there are not any records returned it is throwing an error.

    try Nz(DSUM(...), 0)

  3. #3
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126
    Nope, not the case, I have plenty of records in there...

  4. #4
    Join Date
    Nov 2002
    Posts
    150
    Originally posted by vojtab
    Nope, not the case, I have plenty of records in there...
    What is the error?

  5. #5
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126
    #Error, just found out that when I run the report, it doesn't prompt me for a date!
    To clarify. I run the query qry:ABC, enter beginning and ending date and get data in that range.
    Now I have a report that says =DSum("[field]","qry:ABC") and when I run it, I'm not being asked for the date, I just get an error.... Hmmm

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    i don't use parameter queries. you can achieve the same result with a regular query and a simple pop-up form with the advantage that you get the chance to check the user's input before launching your query.

    domain aggregates have an optional WHERE clause: generate the where from the user's input on the form and dsum(field, table, where)


    izy

Posting Permissions

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