Results 1 to 5 of 5
  1. #1
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47

    parameter for my query help please

    I want to create a parameter that once I enter the number for the shoe code lets say 901. I want my database to send me back that order code along with the order numbers that came 2 days before and 1 day after that order number. How can I create that parameter for my query



    Thank you

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    You would have to substitute your own table and field names, since you didn't provide any...
    Code:
    SELECT tblOrders.ShoeCode, tblOrders.OrderCode, tblOrders.OrderDate FROM tblOrders WHERE (((tblOrders.OrderDate)= 
    (SELECT tblOrders.OrderDate FROM tblOrders WHERE tblOrders.ShoeCode = 901)-2)) OR (((tblOrders.OrderDate)= 
    (SELECT tblOrders.OrderDate FROM tblOrders WHERE tblOrders.ShoeCode = 901))) OR (((tblOrders.OrderDate)<= 
    (SELECT tblOrders.OrderDate FROM tblOrders WHERE tblOrders.ShoeCode = 901)+1));
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    Mircon

    This is my SQL statement from my table

    SELECT TOP 5 MoonPhaseTable.YourDate, MoonPhaseTable.MoonPhaseNumber, MoonPhaseTable.MoonPhaseYourNumber, [All everything].YourTable, [All everything].[Cash3 table], [All everything].Cash4Table, [All everything].Cash4YourNumber, [All everything].GAFiveTable, [All everything].GAFiveYourNumber
    FROM [All everything] INNER JOIN MoonPhaseTable ON [All everything].[YourDate 3 4 5] = MoonPhaseTable.YourDate
    WHERE ((([All everything].[Cash3 table])=[Enter Number]));

  4. #4
    TheSpecialist is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2015
    Location
    Georgia
    Posts
    47
    Mircon

    this is my SQl so far. I want to have a parameter that it will show me lets say if I enter 8 0 1 in my parameter for my cash3Table I want it to pull that date and the numbers and the date that came 2 days before that number and 1 day after that number along with the date as well. Thank you all for your assitance

    SELECT TOP 5 MoonPhaseTable.YourDate, MoonPhaseTable.MoonPhaseNumber, MoonPhaseTable.MoonPhaseYourNumber, [All everything].YourTable, [All everything].[Cash3 table], [All everything].Cash4Table, [All everything].Cash4YourNumber, [All everything].GAFiveTable, [All everything].GAFiveYourNumber
    FROM [All everything] INNER JOIN MoonPhaseTable ON [All everything].[YourDate 3 4 5] = MoonPhaseTable.YourDate
    WHERE ((([All everything].[Cash3 table])=[Enter Number]));

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I had to design a table, populate it and develop the sql statement to arrive at a solution that worked.
    Apply the principle for that which I spent about an hour creating for shoe orders (since that's what you posted) to your new requirement. Sorry, but I'm not going to start over after providing a solution to what was requested.

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

Similar Threads

  1. Replies: 1
    Last Post: 07-21-2015, 03:38 PM
  2. How to run parameter query from VBA
    By John Southern in forum Programming
    Replies: 10
    Last Post: 02-07-2014, 02:24 PM
  3. Replies: 1
    Last Post: 02-28-2013, 01:20 PM
  4. Replies: 3
    Last Post: 08-16-2012, 03:02 PM
  5. Replies: 13
    Last Post: 01-10-2012, 09:56 AM

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