Date question

  • Thread starter Thread starter Ramone
  • Start date Start date
R

Ramone

I'm looking for help with the following line of code
I'm trying to sum reimbursement given to agents by month
One of the controls on the form has a date. I would like
to sum the reimbursement by month based on the date in
the control.

Text72 = DSum("[Reimbursement
Amount]", "[tblInput]", "[Agent ID]=[j05#]AND month
([input date].value)= month(
![tblInput]![Input
date].value)")

Thanks for any help
 
try

= DSum("[Reimbursement Amount]", "[tblInput]", "[Agent ID]= " & [j05#] & "
And Month([Input date])= Month(#" & [input date] & "#)")

the above code assumes that the value of [j05#] is a numeric data type. if
instead it's is a text data type, then try

= DSum("[Reimbursement Amount]", "[tblInput]", "[Agent ID]= '" & [j05#] & "'
And Month([Input date])= Month(#" & [input date] & "#)")

hth
 
Thanks for your help Tina, this works perfect.
-----Original Message-----
try

= DSum("[Reimbursement Amount]", "[tblInput]", "[Agent ID]= " & [j05#] & "
And Month([Input date])= Month(#" & [input date] & "#)")

the above code assumes that the value of [j05#] is a numeric data type. if
instead it's is a text data type, then try

= DSum("[Reimbursement Amount]", "[tblInput]", "[Agent ID]= '" & [j05#] & "'
And Month([Input date])= Month(#" & [input date] & "#)")

hth


I'm looking for help with the following line of code
I'm trying to sum reimbursement given to agents by month
One of the controls on the form has a date. I would like
to sum the reimbursement by month based on the date in
the control.

Text72 = DSum("[Reimbursement
Amount]", "[tblInput]", "[Agent ID]=[j05#]AND month
([input date].value)= month(
![tblInput]![Input
date].value)")

Thanks for any help



.
 
Back
Top