Results 1 to 4 of 4
  1. #1
    elmartinez is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2010
    Posts
    2

    calculation in a query


    I am using Access 2002. I am building a query and have 4 fields, 2 from a table and 2 calculated: Course (text); Years (calculation); Complete (date); NT (calculation). Years looks at Course and says
    Iif(course=XYZ,2,1). What I need it to calculate NT based on adding the number from the Year field to the Complete field. In other words, if my Complete field is 1/1/2009, and my Years field is 2, I want the results in the NT field to be 1/1/2011. Is this possible and how do I do this?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    Check out the DateAdd function.

  3. #3
    elmartinez is offline Novice
    Windows XP Access 2002
    Join Date
    Feb 2010
    Posts
    2
    Yep, you're right! Thank you!

    NT: DateAdd("yyyy",[Years],[Complete])

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    Excellent, glad it worked for you!

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

Similar Threads

  1. Replies: 7
    Last Post: 12-14-2009, 04:49 PM
  2. IIF() in a query calculation
    By bbylls in forum Queries
    Replies: 4
    Last Post: 12-03-2009, 04:42 PM
  3. Query Calculation
    By kellyd in forum Queries
    Replies: 5
    Last Post: 08-31-2009, 11:14 AM
  4. crosstab query calculation
    By rutica in forum Queries
    Replies: 2
    Last Post: 04-28-2009, 09:52 AM
  5. Calculation
    By thestclair in forum Reports
    Replies: 1
    Last Post: 04-29-2006, 11:03 AM

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