Results 1 to 3 of 3
  1. #1
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117

    Help with code Syntax

    Hello,

    I am trying to purge some redundant data from my database by using the following code:
    Code:
    DoCmd.RunSQL "Delete * From [tblDataPrime] WHERE [ToolLastCalDate] = ''"
    I know this syntax works if I put a word inbetween the single quotes after the equals sign.


    However, I need it to target cells which are empty and I have not been able to figure out how to structure that.

    Any and all assistance is appreciated.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    If it is truly a date field, you probably do not have an empty string, but rather a Null. Try:
    Code:
    DoCmd.RunSQL "Delete * From [tblDataPrime] WHERE [ToolLastCalDate] Is Null"

  3. #3
    jtm013 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Aug 2014
    Posts
    117
    Quote Originally Posted by JoeM View Post
    If it is truly a date field, you probably do not have an empty string, but rather a Null. Try:
    Code:
    DoCmd.RunSQL "Delete * From [tblDataPrime] WHERE [ToolLastCalDate] Is Null"
    That did the trick thanks!!!

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

Similar Threads

  1. code syntax for excel formula
    By trevor40 in forum Programming
    Replies: 2
    Last Post: 01-15-2015, 08:05 PM
  2. Syntax Error in my Query Code
    By PPat in forum Queries
    Replies: 5
    Last Post: 04-19-2013, 03:12 PM
  3. code not working/ syntax?
    By mkfloque in forum Programming
    Replies: 7
    Last Post: 02-14-2013, 11:59 AM
  4. VBA Code to report syntax errors via email
    By jazzkenney in forum Programming
    Replies: 6
    Last Post: 11-30-2011, 08:54 PM
  5. Simple code syntax question
    By mseeker22 in forum Programming
    Replies: 1
    Last Post: 07-07-2011, 03:55 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