Results 1 to 2 of 2
  1. #1
    cliff.clayman is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    55

    Angry Comparing Date values that are not formatted the same and null

    I have two date fields that I am trying to compare to see if they match. If they do not match, I want my query to display them. I have having problems formatting both fields to be the same date format and checking them for null values. Here is what I tried to do and I get an error stating that 'The expression you entered has a function containing the wrong number of arguments



    <>IIF(IsNull(Format(CDate([Table1].[DateClosed]),"mm/dd/yyyy"),"N/A",[Table1].[DateClosed])

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Well, the first problem is a missing closing parenthesis for the format function
    Code:
    <>IIF(IsNull(Format(CDate([Table1].[DateClosed]),"mm/dd/yyyy")),"N/A",[Table1].[DateClosed])
    I don't think the expression will work because you cannot refer to a field like you have.
    If this is on a form, maybe try
    Code:
    <>IIF(IsNull(Format(CDate([DateClosed]),"mm/dd/yyyy")),"N/A",[DateClosed])

    Don't know what you are trying to do, so can't give you a better answer...

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

Similar Threads

  1. Date Range search on Field with null Values
    By vbafun in forum Queries
    Replies: 6
    Last Post: 12-06-2013, 07:26 AM
  2. Replies: 3
    Last Post: 09-19-2012, 08:59 AM
  3. Am I doing it wrong? Null Values & Date()
    By the problem in forum Queries
    Replies: 3
    Last Post: 07-25-2012, 01:34 PM
  4. Date Entry in formatted field
    By gg80 in forum Forms
    Replies: 2
    Last Post: 02-10-2012, 06:35 PM
  5. Finding the Max Date and Null Values if Null
    By SpdRacerX in forum Queries
    Replies: 1
    Last Post: 02-03-2012, 06:29 AM

Tags for this Thread

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