Results 1 to 5 of 5
  1. #1
    drewetzel is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34

    Question CInt and Invalid Use of Null

    Hi,



    I have a query containing an expression that subtracts one date/time field from another. Once that action is performed I only want to see the positive outcomes and not the negatives. Since subtracting/adding date/time fields (I believe) results in a text output, I'm using the function CInt to convert the result to a number and then putting the criteria ">=0" on the field. When I run this query I get the error message "Invalid Use of Null". Help, anyone?

    thanks,
    Andrew

  2. #2
    Stingaway is offline Efficiency Junkie
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    The deep south. Keep going until you hit water basically.
    Posts
    224
    What function are you using to subtract the date fields?

  3. #3
    drewetzel is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34
    This is my expression...

    First Drop Factor: [Forms]![Frm_Sales Report]![Start Date]-[Advertising].[InHomeDate]

  4. #4
    Stingaway is offline Efficiency Junkie
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    The deep south. Keep going until you hit water basically.
    Posts
    224
    Try using a date diff function instead, it returns an integer value.

    Examples can be found at:

    http://www.techonthenet.com/access/f...e/datediff.php

  5. #5
    drewetzel is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2011
    Location
    Austin, TX
    Posts
    34
    That worked perfectly. Thanks a lot for the help.

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

Similar Threads

  1. DLookUp function giving invalid use of null error
    By shubhamgandhi in forum Programming
    Replies: 4
    Last Post: 07-21-2011, 06:04 PM
  2. Invalid use of Null
    By Wayne311 in forum Programming
    Replies: 4
    Last Post: 01-27-2011, 05:10 PM
  3. Invalid Use of Null!?!
    By Kipster1203 in forum Access
    Replies: 4
    Last Post: 05-13-2010, 06:09 AM
  4. List box value to variable - invalid use of null?
    By Orabidoo in forum Programming
    Replies: 2
    Last Post: 05-07-2009, 11:06 AM
  5. Replies: 0
    Last Post: 11-17-2006, 09:38 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