Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2008
    Location
    Green Bay, WI
    Posts
    3

    DateDiff function


    I am very new to Access and am trying to use the DateDiff function within a report based on a query. The query is a join of two tables using an ODBC connection. I want to subtract today's date from dates in a column of the report. Is this possible? Also I can not seem to get the syntax correct on the function. Here is what I tried. I created a text box and then in the properties, Control Source, I typed the following: = DateDiff("d",now,[Date_Due_Oper]). Date_Due_Oper is the name of the column that I want to pull the dates from.

  2. #2
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    What kind of error message do you get? Did you put () after Now?

    =DateDiff("d",Now(),[Date_Due_Oper]).

  3. #3
    Join Date
    Dec 2008
    Location
    Green Bay, WI
    Posts
    3
    The error is attached.

  4. #4
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    Sorry, don't know what's going on. The syntax looks fine to me.

  5. #5
    jya is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2007
    Location
    Chicagoland
    Posts
    109
    I'm guessing you may have a hidden character in there. You want to try just using single quotes (ex. 'd') or retype the whole expression.

  6. #6
    Join Date
    Dec 2008
    Location
    Green Bay, WI
    Posts
    3
    Tried with single quotes no luck. also retyped in, same error. If I figured it out I will post the answer.

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

Similar Threads

  1. Is there a function to do this....
    By Nowherefast in forum Access
    Replies: 2
    Last Post: 12-31-2008, 08:08 AM
  2. Datediff() help needed
    By geoff44 in forum Access
    Replies: 2
    Last Post: 11-20-2008, 04:44 PM
  3. SELECT FUNCTION help please
    By scott munkirs in forum Queries
    Replies: 0
    Last Post: 10-17-2006, 07:44 AM
  4. transferspreadsheet function
    By jeffj in forum Import/Export Data
    Replies: 3
    Last Post: 03-13-2006, 11:59 AM
  5. Need Help for Dlookup function
    By wasim_sono in forum Programming
    Replies: 5
    Last Post: 01-04-2006, 08:18 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