Results 1 to 2 of 2
  1. #1
    Eveline is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    1

    Use field value as the year in a date

    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 the "2008" 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. 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.

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Hi Eveline,

    Try the DateSerial function:

    Code:
    =DateSerial([Contract Year],12,31)
    Cheers,

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Date manipulaton for Financial Year
    By Neil Bingham in forum Access
    Replies: 0
    Last Post: 02-15-2009, 11:24 AM
  2. Changing a date to the current year
    By fdnyfish in forum Access
    Replies: 1
    Last Post: 03-01-2008, 08:34 AM
  3. Retrieving Week of Year in a date range
    By Korvega in forum Queries
    Replies: 2
    Last Post: 05-27-2006, 06:29 AM
  4. Finding data between two date for any year
    By gemini2 in forum Access
    Replies: 4
    Last Post: 04-05-2006, 06:20 AM
  5. Replies: 1
    Last Post: 12-09-2005, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums