Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham - UK
    Posts
    113

    Unanswered: Date Query - URGENT

    Hi Folks

    Im using Access 2000.

    I have 2 date fields in table, in field 'DATE1' is a date / time for every record- what I need to do is is have an update query to write into 'DATE2' field with date from 'DATE1' plus 7 years.

    Can anyone help - its very urgent !!!

    Donald
    Last edited by donaldt; 03-30-06 at 07:53.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    odd that you should want to stroe such derived data, but you could do this with an update query


    set Date2= date1 + <offset>

    where offset is the number that represents 7 years

    I'm not ion a Microsoft platform at present, and I can't remember it

    a really crude technique could be do a simple subtraction

    alternatively something like
    set date2 = cdate(day(date1) & "/" & month(date1) & "/" & year(date1)+7)
    should do the trrick
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Another trick would be to use the update query as Mark said but use the DateAdd function instead ...
    Back to Access ... ADO is not the way to go for speed ...

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    good call, I keep forgetting about the datepart/dateadd functions - it must be the alzheimers kicking in yet again
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •