Results 1 to 3 of 3
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    SQL Query against Date

    I do not allows NULLs in my database so for "empty" date fields I insert a 0 in that field.

    This displays like '1899-12-30 00:00:00.000' in my SQL table.

    How would I query against this table when searching for all date values that are not empty? I've tried using '<> 0' but that didn't work.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Probably one reason I want nulls in my db but I don't know SQL db.

    Maybe: >= #1/1/1900#
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe

    WHERE DateField = '1899-12-30 00:00:00.000'

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

Similar Threads

  1. Replies: 5
    Last Post: 12-12-2013, 12:14 PM
  2. Replies: 1
    Last Post: 05-09-2013, 09:13 AM
  3. Replies: 25
    Last Post: 11-16-2012, 12:47 PM
  4. Replies: 3
    Last Post: 09-19-2012, 08:59 AM
  5. Replies: 3
    Last Post: 08-21-2012, 03:05 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