Date question

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
 
T

tina

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
 
R

Ramone

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



.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top