Counting

  • Thread starter open a adobe file from a command button
  • Start date
O

open a adobe file from a command button

I have a table with a field named 'memodate'. I'm trying to count them by
year so I can say we have 100 that are 1 year old, 350 that are 2 years old,
etc.. My source code is:
=DCount("[memodate]","tbl-bond","(datediff,y,now,memodate)") but it does not
work. Can anyone offer help??

Thanks
William
 
S

Sergey Poberezovskiy

Try the following:

DCount("memodate", "tbl-bond", "DateDiff('yyyy', memodate, Now)=1")

and then sustitute 1 to 2, 3 or whatever number of years you need...
 
J

John Vinson

I have a table with a field named 'memodate'. I'm trying to count them by
year so I can say we have 100 that are 1 year old, 350 that are 2 years old,
etc.. My source code is:
=DCount("[memodate]","tbl-bond","(datediff,y,now,memodate)") but it does not
work. Can anyone offer help??

Thanks
William

Yes; Marshall and I have both replied, prior to your posting this
message for the fourth time. Did you check to see if you had gotten an
answer prior to posting? If so, what's wrong with the answers you've
already gotten?

John W. Vinson[MVP]
 
O

open a adobe file from a command button

John, Hi. Sorry. I posted this question from both my office and from home.
The solution Sergey posted works.

John Vinson said:
I have a table with a field named 'memodate'. I'm trying to count them by
year so I can say we have 100 that are 1 year old, 350 that are 2 years old,
etc.. My source code is:
=DCount("[memodate]","tbl-bond","(datediff,y,now,memodate)") but it does not
work. Can anyone offer help??

Thanks
William

Yes; Marshall and I have both replied, prior to your posting this
message for the fourth time. Did you check to see if you had gotten an
answer prior to posting? If so, what's wrong with the answers you've
already gotten?

John W. Vinson[MVP]
 
O

open a adobe file from a command button

This works correctly. Thank you very much. I'm finding that I don't have
the patience for this. Is that something I have to develope like my code or
should I quit before I go cazy

Sergey Poberezovskiy said:
Try the following:

DCount("memodate", "tbl-bond", "DateDiff('yyyy', memodate, Now)=1")

and then sustitute 1 to 2, 3 or whatever number of years you need...


open a adobe file from a command button said:
I have a table with a field named 'memodate'. I'm trying to count them by
year so I can say we have 100 that are 1 year old, 350 that are 2 years old,
etc.. My source code is:
=DCount("[memodate]","tbl-bond","(datediff,y,now,memodate)") but it does not
work. Can anyone offer help??

Thanks
William
 

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