Using Datetimes in Access 2007 queries

Posted on 2012-09-02
Last Modified: 2012-09-03
I am used to SQL Server Management Studio and am transporting my SQL queries into Access 2007.  How would I write this in Access?

SELECT Orders.[Order Date]
FROM Orders
    Orders.[Order Date] >= '01/01/2004 00:00:00' and
Orders.[Order Date] < '01/01/2005 00:00:00'
Question by:chaverly
    1 Comment
    LVL 48

    Accepted Solution

    Like this:

    SELECT Orders.[Order Date]
    FROM Orders
        Orders.[Order Date] >= #01/01/2004 00:00:00#
        Orders.[Order Date] < #01/01/2005 00:00:00#


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now