Easy DateDiff question

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hi all. I think I just have a syntax or type mismatch going on, but I need to
calculate the difference in days between a field called "Original List Date"
in a table called "MLS" and the current date. Here are two ways I'd like to
calculate this:

1. Have the resulting calculation as a field called "DOM" in the "MLS"
table. I can then simply put this field on my form.

OR

2. Have a text box/control on the form itself that calculates the date
difference.

If you can help, please be specific as I think it's a minor problem that I
can't quite get past. FYI, this is an Access 2003 database.

Thanks for your assistance,
Mike
 
Add a text box to your form.

Give it these properties:
Control Source: =Date() - [Original List Date]
Format General Number

(Don't store the value in your table.)
 
Thanks. I would expect that to work but the resulting text box is "#Name?"
I've verified no typos anywhere from the original field name to the code you
gave in the control -- it all matches. What would cause this? Is is the
spaces in the field name?

Thanks,
Mike

Allen Browne said:
Add a text box to your form.

Give it these properties:
Control Source: =Date() - [Original List Date]
Format General Number

(Don't store the value in your table.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Michael said:
Hi all. I think I just have a syntax or type mismatch going on, but I need
to
calculate the difference in days between a field called "Original List
Date"
in a table called "MLS" and the current date. Here are two ways I'd like
to
calculate this:

1. Have the resulting calculation as a field called "DOM" in the "MLS"
table. I can then simply put this field on my form.

OR

2. Have a text box/control on the form itself that calculates the date
difference.

If you can help, please be specific as I think it's a minor problem that I
can't quite get past. FYI, this is an Access 2003 database.

Thanks for your assistance,
Mike
 
Wow, I just figured out what's been driving me nuts. I found another article
that says you get that error if there is a space before the equal sign in the
control source. Unbelievable. But now all's well. Thanks for your assistance!

Michael said:
Thanks. I would expect that to work but the resulting text box is "#Name?"
I've verified no typos anywhere from the original field name to the code you
gave in the control -- it all matches. What would cause this? Is is the
spaces in the field name?

Thanks,
Mike

Allen Browne said:
Add a text box to your form.

Give it these properties:
Control Source: =Date() - [Original List Date]
Format General Number

(Don't store the value in your table.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Michael said:
Hi all. I think I just have a syntax or type mismatch going on, but I need
to
calculate the difference in days between a field called "Original List
Date"
in a table called "MLS" and the current date. Here are two ways I'd like
to
calculate this:

1. Have the resulting calculation as a field called "DOM" in the "MLS"
table. I can then simply put this field on my form.

OR

2. Have a text box/control on the form itself that calculates the date
difference.

If you can help, please be specific as I think it's a minor problem that I
can't quite get past. FYI, this is an Access 2003 database.

Thanks for your assistance,
Mike
 

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

Similar Threads

DateDiff problem 3
Datediff Help 3
DateDiff on blank fields? 4
DateDiff 3
DateDiff to calculate work days 2
DateDiff Question 4
DateDiff Question 2
DateDiff 13

Back
Top