Results 1 to 5 of 5
  1. #1
    hellfire45 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Mar 2015
    Posts
    24

    Help with GUI Syntax and/or SQL

    Hey guys. I really suck at MS Access. Can somebody please help this lost soul?

    I need to filter my query with the following:



    END is null
    or
    end is NOT null and is currentdate - 60


    I'd like to know how to enter this properly into the GUI and/or SQL but if I put it in the GUI I guess Access will show my the SQL anyway.

    Thanks so much!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    If you mean END is a field like [end date] then yes, you can , in the sql gui, say: [end] is null.
    (fields are more readable in brackets)

    but for date calculations , I would use
    [end] is null OR [end] = datediff("d",-60,[end])

  3. #3
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    End is a reserved word - using it will cause problems at some point - suggest rename as EndDate or similar

    also

    [end] = datediff("d",-60,[end])
    will always return false

  4. #4
    hellfire45 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Mar 2015
    Posts
    24
    END if the name of the column.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    The snippets you posted doesn't really help.
    It would help if you post the SQL of the query so we have some context.

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

Similar Threads

  1. Please help with syntax
    By mshaynerush in forum Programming
    Replies: 5
    Last Post: 10-11-2013, 11:27 AM
  2. Help with syntax
    By Gizmodo in forum Queries
    Replies: 4
    Last Post: 11-16-2012, 01:45 PM
  3. SQL syntax
    By jgelpi16 in forum Programming
    Replies: 2
    Last Post: 05-04-2011, 08:32 AM
  4. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  5. Please help SQL Syntax
    By jordanturner in forum Access
    Replies: 4
    Last Post: 09-02-2010, 08:05 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