Results 1 to 3 of 3

Thread: DSum Function

  1. #1
    Join Date
    May 2008

    Unanswered: DSum Function

    I was having an issue with DSum Function. Some users advised to use following expression to arrive at desired figure, but it has still not worked.

    =DSum("[Total Input]","Production","[End of Production] = #" & DateValue([Forms]![MIS]![Text0]) & "#")

    I have done a slight modification in the expression (as given below). Actually, I have removed DateValue & also used Form's, Form Name and Field in one Square bracket & now it is perfectly working.

    =DSum("[TInput]","Production1","[End of Production]= #" & [Forms!MIS!Text0] & " # ")

    Similar to this, I have an another issue. Now, inplace of a particular date, I want to get the value (Total Input) from the same table [Production] but pertaining to the month of Entered Date [Text0]. I have tried various expressions like Month(Text0), Format(Text0,"mmm") but not getting desired output.

    I shall be thankful if anybody help me for the same.

  2. #2
    Join Date
    May 2005
    I think (off the top of my head) you'll need something like:

    =DSum("[TInput]","Production1","(MONTH([End of Production]) = " & MONTH([Forms!MIS!Text0]) & ") AND (YEAR([End of Production]) = " & YEAR([Forms!MIS!Text0]) & ")"

    Or alternatively,

    =DSum("[TInput]","Production1","FORMAT([End of Production], 'yyyymm') = '" & FORMAT([Forms!MIS!Text0],"yyyymm") & "'"

    Give it a shot at least.
    Last edited by nckdryr; 06-04-09 at 02:36.
    Me.Geek = True

  3. #3
    Join Date
    May 2008
    Thank you for your much for your valuable suggestion, what I wanted.
    Now, its working perfectly. Isue stands closed.

Posting Permissions

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