Results 1 to 3 of 3
  1. #1
    Join Date
    May 2016
    Posts
    1

    Unanswered: MS Access query & parameters

    Hi

    Am trying to write a query, using records that has a field for year and a field for period, numbers 1 to 12. The current query asks what is the latest period
    <=[latest actual period], I want to ask that question but only return records that are >=4, how do I express this in the criteria field.

    Plus how would I ask the query to return records that is for selection year 2016 period 4 to year 2017 period 3 inclusive.#

    Thanks

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    youll need a new query:

    [period]
    >=[Enter period]


    question2:
    I would start using a form for your params, say frmRpts,
    with text boxes named:
    txtStartYr
    txtStartPd
    txtEndYr
    txtEndPd

    txtSTart, txtEnd . These boxes would combine the date range (if periods are months)
    txtSTart = txtStartPd & "/1/" & txtStartYr
    txtEnd = txtEndPd & "/1/" & txtEndYr

    a query would use the dates, NOT periods and years.

    then the query would be:
    select * from qsDAta where YearPd between forms!frmRpts!txtStart and forms!frmRpts!txtEnd

  3. #3
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,422
    Provided Answers: 8
    a good Idea when you getting a Query to ask a question like <=[latest actual period]

    Put a ?? in <=[latest actual period ??]

    only reason is Then U know you asked the Question and that you haven't done spelling mistake
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

Posting Permissions

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