Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Retrieve First and Last record from a query used on one form

Discussion in 'Information Technology' started by Kou Vang, Nov 1, 2005.

  1. Kou Vang

    Kou Vang
    Expand Collapse
    Guest

    The query has values by date and time. I want to be able to allow the user
    to view the first date and time and the last date and time, and determine a
    24 or 48 hour interval to run another query by what the user selects, but I
    am having trouble with the data coming from one query, and the [DATE] field
    can only be sorted either Ascending or Descending. How do I get around this?
    Show a first and last, but from the same field, from the same query?
    Possible?
     
  2. Loading...

    Similar Threads Forum Date
    USA Obama: U.S. Will Help New Governments Retrieve Assets Breaking News May 19, 2011
    Sikh News New Orleans: Sikh holy book retrieved (Rediff.com) Breaking News Sep 11, 2005
    Sikh News Sikh holy book retrieved from under water (Hindustan Times) Breaking News Sep 10, 2005
    Last Blog Blogs Oct 14, 2016
    That Pesky Last 1% Blogs Oct 12, 2016

  3. Sprinks

    Sprinks
    Expand Collapse
    Guest

    Kou,

    You could include another subform sorted in the opposite direction, or if
    the user just needs to see the min and max values, you could use a UNION
    query to display them:

    SELECT TOP 1 YourTable.YourDateField
    FROM [YourTable]
    ORDER BY YourTable.YourDateField DESC;
    UNION
    SELECT TOP 1 YourTable.YourDateField
    FROM [YourTable]
    ORDER BY YourTable.YourDateField;

    Sprinks

    "Kou Vang" wrote:

    > The query has values by date and time. I want to be able to allow the user
    > to view the first date and time and the last date and time, and determine a
    > 24 or 48 hour interval to run another query by what the user selects, but I
    > am having trouble with the data coming from one query, and the [DATE] field
    > can only be sorted either Ascending or Descending. How do I get around this?
    > Show a first and last, but from the same field, from the same query?
    > Possible?
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page