DSUM - Multiple criteria including Yes/No Field

  • Hi folks,


    Any chance one of your esteemed selves can spot the issue with this syntax?


    Code
    1. strCT = Nz(DSum("[Overtime Hours]", "tblOT", "[OT Area] = '" & [strOta] & "'" _
    2. & " And [OT Date] = #" & Format([strOTD], "mm\/dd\/yyyy") & "# And "[Gas] = No")) + 0


    All was well until I tried to add the yes/no criteria ([Gas]) on, now having no joy no matter what I try.



    Thanks in advance!

  • Re: DSUM - Multiple criteria including Yes/No Field


    It appears to me that you are missing the second argument for the NZ function. It should be where I have placed the triple X, unless I have missed something.

    Code
    1. strCT = Nz(DSum("[Overtime Hours]", "tblOT", "[OT Area] = '" & [strOta] & "'" _
    2. & " And [OT Date] = #" & Format([strOTD], "mm\/dd\/yyyy") & "# And "[Gas] = No"),XXX) + 0
  • Re: DSUM - Multiple criteria including Yes/No Field


    Thanks for the response!


    I noticed that myself.... NZ with no replacement value. Its returning "Expected List separator or )" I can't see where for the life of me.


    Sorry btw that probably should have been in the original description.