Use field value as the year in a date

Joined
Mar 11, 2010
Messages
1
Reaction score
0
I work with MS Access 2003.

I am creating a query to show all contracts set up in a certain year that have been cancelled in that specific year. This "Cancelled" field is not a yes/no field, but includes the date on which it has been cancelled (always starting 31/12/YYYY).

First, to show me the contracts set up in a certain year (say 2008) , i created a parameter under the "Contract Year" field, asking which year you want to see (in this case 2008).

I wish to add a criteria that then shows cancelled contracts at the end of that specific year, so 31/12/2008. So whether it is "2008" or another year is dependent on the value in the "Contract Year" field.

I tried the following as criteria for the Column "Cancelled":

#31/12/[Contract Year]#

to try and have it take the year mentioned in that field.
But it doesn't work. Access sees is as a second parameter, instead of a field name.
I tried adding LIKE to it and the &-sign, still no luck.

Is it possible to use a field name in a date criteria and if so, how could i do it?

Thank you very much in advance for your 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