Results 1 to 9 of 9
  1. #1
    nizam is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    24

    Query Design to Filter datas "in between"

    Hi friends,
    I need a help to design a query to filter datas (not dates) in between two ranges. For Eg:-
    I have 10 line numbers;
    Line No1
    Line No2
    Line No3
    .
    .
    .
    Line No10.

    Each Line No is have 100 Joint Nos;
    Eg:- Line No1, J#01,J#02.......J#100
    Line No2, J#01,J#02.......J#100
    etc

    I need to make a Query to filter datas of " each line number" from a particular J# to another J# (Continuous ascending only)



    Please advise me how to make expression / criteria for the design of this query...

    Thanks in advance
    Nizam,

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,620
    Are J#01, J#02, etc fields? Or are these values in a field? What is that field name?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    nizam is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    24
    Quote Originally Posted by June7 View Post
    Are J#01, J#02, etc fields? Or are these values in a field? What is that field name?

    The J# 01,J#02 etc are in the same filed names "Joint Nos"

    Eg as shown,

    Line No Joint No

    Line#1 J#01
    Line#1 J#02
    Line#1 J#03
    ...
    ...
    .
    .
    Line#2 J#01
    Line#2 J#02
    Line#2 J#o3
    ..
    ..
    ..
    Line#10 J#01
    Line#10 J#02

    etc ..
    Means a Line No is having Many joint numbers..

    I need to make query to check the status of the Joint numbers, in a particular line number,
    say eg:- i need to check the status of J#10 to J#25 in Line#1 or any other line number..
    I know the way to ask [Line No] when we run the query, but i need to ask joint No also from which joint to which joint..

    plz advise

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,620
    That would be simple if the number part of the value was always the same length. Example J#001, J#002, ... J#100. This is alpha sorting and your structure of the value will not sort J#100 properly. Either correct the data or have to extract the number part with expression in query and filter on that constructed field. Example:
    Val(Mid([Joint No],3)) Between 7 And 22
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    nizam is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    24
    Plz make it clear little more, what i have to put the expression, i need the ask when running the query, first no and the last number for the specified line no,
    plz

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,620
    Put expression in cell of Field row in query design.
    Val(Mid([Joint No],3))

    Then in the Criteria row
    Between value1 And value2
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    nizam is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    24
    No chance boss, when try to run, the error message coming as
    "you tried to execute a query that does not include the specified expression 'Val(Mid([Joint No],3)) between value1 and value2 as part of an aggregate function.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,620
    Post your SQL statement. I expected you would do a simple SELECT, not a totals (Group By).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    nizam is offline Novice
    Windows Vista Access 2007
    Join Date
    Jun 2011
    Posts
    24
    Dear I Solved the Issue.. Thank god,,
    it is so simple....
    just in the criteria column, i put 2 criterias, > and < ,, then it will ask the criteria when it runs and it will give the exact required..
    Thanks a lot for you kind support.. looking ahead

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

Similar Threads

  1. Replies: 16
    Last Post: 07-22-2011, 09:23 AM
  2. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM
  3. How to Filter When Using The "Create E-Mail" Wizard
    By MFriend in forum Import/Export Data
    Replies: 3
    Last Post: 07-16-2010, 09:45 AM
  4. Importing Table "DESIGN"
    By vCallNSPF in forum Access
    Replies: 2
    Last Post: 06-01-2010, 05:03 PM
  5. Create "reset filter" button
    By vanlanjl in forum Access
    Replies: 0
    Last Post: 03-03-2009, 07:36 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