none
Access - create a report from a date range in a query

    Question

  • I have managed to create a Report from a form that displays data per date

    In the query criteria for the date it references the form

    [Forms]![equipe_form]![Date de Vente]

    The report is based on the results of the query as per the information entered in the form

    so far so good

    However, I want the user to be able to select a date range in the form - what do i enter in the query and how do i reference these to fields in the form

    Saturday, January 15, 2011 5:45 PM

All replies

  • You need to add some controls to the form in which the user can enter/select the start date and the end date for the range and then in the query that provides the data to the form, set criteria based on those controls for the field in the data that contains the dates.


    Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Loopyl00" wrote in message news:6250d4fb-a0d8-43fc-a834-ea0f81334461@communitybridge.codeplex.com...

    I have managed to create a Report from a form that displays data per date

    In the query criteria for the date it references the form

    [Forms]![equipe_form]![Date de Vente]

    The report is based on the results of the query as per the information entered in the form

    so far so good

    However, I want the user to be able to select a date range in the form - what do i enter in the query and how do i reference these to fields in the form


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    Saturday, January 15, 2011 9:42 PM
  • Yes i got that far, creating two boxes for StartDate and EndDate on the Form

    What is the criteria on the Date field for the query?

    Sunday, January 16, 2011 12:42 AM
  • The criteria part of the SQL would be

    WHERE ((([TableName].[DateFieldName])>=[Forms]![equipe_form]![StartDate] And ([TableName].[DateFieldName])<=[Forms]![equipe_form]![EndDate]))


    Hope this helps.

    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge

    "Loopyl00" wrote in message news:5c7c0d93-4c49-4813-93f0-e9c9b3f27000@communitybridge.codeplex.com...

    Yes i got that far, creating two boxes for StartDate and EndDate on the Form

    What is the criteria on the Date field for the query?


    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org
    Sunday, January 16, 2011 11:22 AM