Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    2

    Between date

    hi experts,



    i am a novice. i know how to use criteria to create a parameter for user to enter "from date" and "to date" to retrieve information. I want to know how can i write a simple SQL language to activate my "from date" and "to date" on the form design? also, how can i retrieve only selected information that i need only instead of all the fields information? i have created two unbound text.

    Thanks

  2. #2
    Join Date
    Jun 2005
    Location
    Northampton, England
    Posts
    14
    Create a query with whatever fields you wish to see. In the criteria of the date field, refer to your form on which you have the text boxes. an example would be

    SELECT TableName[FieldName1], TableName.DateFieldName, TableName.FieldName3
    FROM TableName
    WHERE (((TableName.DateFieldName) Between [forms]![frmFormName]![txtBeginDate] And [forms]![frmFormName]![txtEndDate]));

    Just change the table, form name and text box names to suit.

  3. #3
    Join Date
    Nov 2006
    Posts
    2

    Between Date

    Hi Tanis,

    Thanks! so sorry, i need more advice from you. First let me tell you my situation and then you help me to assess okay.

    I have created two unbound text [Start Date] & [End Date] on my form.
    My form name is [TblWklySurveillanceReportForm]
    My table name is [TblWklySurveillanceReport]
    My field name is [Inspection Date] only one field was created!

    I am not quite sure what you meant by [FieldName1] & [FieldName3]. However, I try to input in whatever i know below. Syntax error came out! Pls help!

    SELECT TableWklySurveillanceReport[FieldName1], TableWklySurveillanceReport.Inspection Date, TableWklySurveillanceReport.FieldName3
    FROM TableWklySurveillanceReport
    WHERE (((TableWklySurveillanceReport.Inspection Date) Between [forms]![TblWklySurveillanceReportForm]![Start Date] And [forms]![TblWklySurveillanceReportForm]![End Date]));


    Thanks!
    Hondasteed

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 12-09-2005, 10:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums