Query on user inputed date parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mash4t
    New Member
    • Dec 2006
    • 1

    #1

    Query on user inputed date parameters

    I'm sitting in my IT class and I have two problems. One is easy, the second not so. My first problem is a query I am making. I want to create a query that searches for dvds released between two years, with a pop up box appearing when the query is opened, asking which years to seach between. I have no idea how to do this. I was trying to do
    Code:
     Between #[ ]# And #[ ]#
    . but it wouldn't work. What would I have to type as my criteria.

    My second problem is with another query. I want to make a query that shows which Users appear a set number of times within a table. For example, Users that appear twice in a table. Is this even possible?

    Thanks for your help
  • jpatchak
    New Member
    • Oct 2006
    • 76

    #2
    For your second question, you would want something like:

    Code:
    SELECT Table1.User, Count(Table1.User) AS UserCount
    FROM Table1
    GROUP BY Table1.User
    HAVING (((Count(Table1.User))=2));

    Comment

    • ADezii
      Recognized Expert Expert
      • Apr 2006
      • 8834

      #3
      Originally posted by mash4t
      I'm sitting in my IT class and I have two problems. One is easy, the second not so. My first problem is a query I am making. I want to create a query that searches for dvds released between two years, with a pop up box appearing when the query is opened, asking which years to seach between. I have no idea how to do this. I was trying to do
      Code:
       Between #[ ]# And #[ ]#
      . but it wouldn't work. What would I have to type as my criteria.

      My second problem is with another query. I want to make a query that shows which Users appear a set number of times within a table. For example, Users that appear twice in a table. Is this even possible?

      Thanks for your help
      'Create a new Query containing the [Release_Date] field and any other Fields
      'that you want to see in the result set. In the Criteria Row of the [Release_Date]
      'Field type the following line in order to be prompted for a Beginning and
      'Ending Release Date, then to havew the proper Recordset returned:
      Code:
      Between [Enter Beginning Date:] And [Enter Ending Date:]

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        These two posts do answer both of your questions correctly.
        However, if you want an explanation of what does what with dates etc in queries, see (Literal DateTimes and Their Delimiters (#).)

        Comment

        Working...