Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Thanked 0 Times in 0 Posts

    Query showing a chosen month ? (Access 2000)

    I need to build a query showing a chosen month from an Option button in a form.Can somebody help me how to

    do it ? I imagine my option button should consists of the name of the months, and when i press the button

    January, to open the query only for january .

    My query is the following:

    SELECT DISTINCTROW Orders.orderid, Orders.invoicedate, Year([invoiceDate]) AS [Year]
    FROM Orders
    WHERE (((Year([invoiceDate]))=2003))
    ORDER BY Orders.invoicedate;

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Query showing a chosen month ? (Access 2000)

    Create an Option Group with the Control Wizard. Enter the names of the months as captions, and accept the option values proposed by Access (January = 1, February = 2 etc.), since this corresponds to standard month numbering. Name the option group grpMonths. Expand the query as follows:

    SELECT DISTINCTROW Orders.OrderID, Orders.InvoiceDate, Year([InvoiceDate]) AS [Year]
    FROM Orders
    WHERE Year([InvoiceDate])=2003 And Month([InvoiceDate])=[Forms]![frmWhatever]![grpMonths]
    ORDER BY Orders.InvoiceDate;

    Replace frmWhatever by the name of your form.

Posting Permissions

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