Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Location
    Virginia, USA
    Posts
    98

    Question Unanswered: Another Query Question

    I have a query that already goes out and retrieves a set phones by organization code but I'm looking at adding to the query so the user can select a date range to search by and need the code for this if someone can help.

    The query (as it is right now) follows:

    SELECT tblBilling2004.CustID, tblBilling2004.[CustCompany], tblBilling2004.BillingCode, tblBilling2004.SerialNumber, tblBilling2004.MobileNumbers, tblBilling2004.[Date of Call], tblBilling2004.[Time of Call], tblBilling2004.Duration, tblBilling2004.[Rate/Min], tblBilling2004.[Total Cost of Call]
    FROM tblBilling2004
    WHERE (((tblBilling2004.BillingCode) Like ("B*") Or tblBilling2004.BillingCode) Like ("P*")))
    ORDER BY tblBilling2004.BillingCode;

    I Have another query that allows the user to select a serial number to search for but wasn't sure how to do a user selected date range. That code is:

    SELECT *
    FROM tblPhoneMaster
    WHERE MobileNumber Like "*" & [Enter PhoneNumer] & "*";


    Looking for something that allows the users to enter a date range such as:

    04/01/2004 - 10/01/2004

    mm/dd/yyyy format

    Thanks in advance

    KC

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    as a parameter or through a form? or somehing else the answers are different for both cases

    For a parameter

    WHERE [Date of Call] > [Please type the Start Date] AND [Date of Call] < [Please Type End Date]

    For a choice from a form use something like

    Forms!FormName!ControlName in place of your parameters

  3. #3
    Join Date
    Sep 2004
    Location
    Virginia, USA
    Posts
    98
    David,

    It will be through a parameter. Thanks a bunch for the quick response. I'll give it a try.

    KC

  4. #4
    Join Date
    Sep 2004
    Location
    Virginia, USA
    Posts
    98
    Works great!!

    Thanks again.

    KC

  5. #5
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    No problem, the only problem that may occur is if someone doesnt type in a date

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •