Results 1 to 3 of 3
  1. #1
    fadilrexhepi is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Posts
    6

    MIN or MAX Value to return in a same column

    HI,

    I am having an issue with a select query as I want one column to show the MAX and "00" value of the same Column. How do I go about having this task completed.

    Any help is greatly apprecaited



    For example, the column has 00,01,02,03,04,05,*1,*2,*3,*4,*5 so I want a query that will help me return values of "00" and "05" on this example
    00
    05

    Further example, this is what I have now
    SELECT qryPR34_UNION.PR34001, qryPR34_UNION.PR34002, qryPR34_UNION.PR34003, qryPR34_UNION.PR34005, qryPR34_UNION.PR34006, qryPR34_UNION.PR34007, qryPR34_UNION.PR34013, qryPR34_UNION.PR34014, qryPR34_UNION.PR34098, qryPR34_UNION.PR34099, qryPR34_UNION.PR34100, qryPR34_UNION.PR34101
    FROM qryPR34_UNION
    WHERE (((qryPR34_UNION.PR34002)>"0") AND ((qryPR34_UNION.PR34003)>"0") AND ((qryPR34_UNION.PR34006)<"0") AND ((qryPR34_UNION.PR34099)>0));

    on the WHERE command, I need field PR34005 to give me the "00" value or the MAX value (on my example the result will have to give me records that have "00" and "05" value assigned on PR34005


    Please help

    Fadil

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,847
    General format (example)

    Code:
    SELECT MAX(Price) AS HighestPrice, Min(Price) as LowestPrice FROM Products;

  3. #3
    fadilrexhepi is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2015
    Posts
    6
    Hi,
    Thank you very much for your help. I am trying to add this to my query but no luck. How would I add that command to the following syntax

    SELECT qryPR34_UNION.PR34001, qryPR34_UNION.PR34002, qryPR34_UNION.PR34003, qryPR34_UNION.PR34005, qryPR34_UNION.PR34006, qryPR34_UNION.PR34007, qryPR34_UNION.PR34013, qryPR34_UNION.PR34014, qryPR34_UNION.PR34098, qryPR34_UNION.PR34099, qryPR34_UNION.PR34100, qryPR34_UNION.PR34101
    FROM qryPR34_UNION
    WHERE (((qryPR34_UNION.PR34002)>"0") AND ((qryPR34_UNION.PR34003)>"0") AND ((qryPR34_UNION.PR34006)<"0") AND ((qryPR34_UNION.PR34099)>0));

    In WHERE, I will need to add also an OR command where qryPR34_UNION.PR34005 returns the "00" (not min but 00) value or qryPR34_UNION.PR34005 returns the MAX value.

    Thank you very much
    Fadil

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

Similar Threads

  1. Replies: 6
    Last Post: 12-15-2014, 07:53 PM
  2. return column number by VBA
    By ice051505 in forum Programming
    Replies: 4
    Last Post: 02-25-2013, 01:48 PM
  3. Replies: 2
    Last Post: 07-27-2012, 08:27 AM
  4. Replies: 5
    Last Post: 02-09-2011, 11:22 AM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 AM

Tags for this Thread

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