Results 1 to 4 of 4
  1. #1
    jlee8384 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2019
    Posts
    8

    Datediff query populates field with '#Func!' instead of day difference

    I'm trying to include a field that shows the difference between 2 dates within a query used in Access. I have it within the SELECT statement as below:



    SELECT O.Ship_Date, O.Drop_Date, DateDiff('day', O.Ship_Date, O.Drop_Date) AS Gap_Days
    From Orders AS O;

    When I save this in the SQL view and go to Datasheet view, the two dates populate, but the calculated Gap_Days field shows as '#Func!'. I'm guessing it's saying I have some function syntax error, but I can't figure out what it is.

    I've also tried

    SELECT O.Ship_Date, O.Drop_Date, DateDiff('day', [O].[Ship_Date], [O].[Drop_Date]) AS Gap_Days
    From Orders AS O

    But I get the same result. Anyone have any ideas?

    Thanks in advance.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    use 'd' rather than 'day'

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Maybe try "d" instead of "day"

    If still not try putting actual dates instead of those 2 fields just to see if it works. If it does then something wrong with those fields.


  4. #4
    jlee8384 is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2019
    Posts
    8
    Changing to 'd' worked. Thanks guys!

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

Similar Threads

  1. Replies: 4
    Last Post: 09-20-2018, 11:59 AM
  2. cant write correctly dsum func
    By nahum abramovich in forum Access
    Replies: 12
    Last Post: 06-04-2018, 01:37 AM
  3. Replies: 1
    Last Post: 07-01-2016, 08:24 AM
  4. Replies: 1
    Last Post: 05-27-2013, 09:46 PM
  5. Replies: 1
    Last Post: 11-13-2010, 12:57 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