Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2004
    Posts
    139

    Unanswered: DateAddW function

    When using dateadd function you can add the number of day indicated to your date in a query. I want to add a specified number of days to the [recdt] field in a query but I want only workdays added. From research, I understand that I should use dateaddw([recdt],3) but it keeps saying undefined function.

    Here is what I have in my query.

    Recdt field in first column and out:dateaddw(recdt],3) in the second column.

    Could someone please tell me how to add 3 workdays to the recdt column and make it work?

    Appreciate any help!
    B&R

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    Sounds like a UDF to me. Could you link to your source?

    Cheers
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    In fact this looks like what you mean
    Testimonial:
    pootle flump
    ur codings are working excelent.

  4. #4
    Join Date
    Feb 2004
    Posts
    139
    You found it! Only difference is that I found it in Microsoft. Can you help me put this in the query?

    Thanks,
    B&R

  5. #5
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by B&R
    Only difference is that I found it in Microsoft.
    I found that too - I think the one I linked to was a copy and paste job.

    Have you followed the instructions in the link? The query looks fine and the error message indicates something else: You will need to copy and paste the DateAddW function into a new, blank module in your database. You will then not get the "undefined function" method and your query should work.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  6. #6
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    I use this Date function

    form http://www.mvps.org/access/datetime/date0012.htm

    Been using to for Years
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  7. #7
    Join Date
    Feb 2004
    Posts
    139
    Thanks! I copied the code into a module and it worked great.

    B&R

Posting Permissions

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