Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2008
    Posts
    8

    Unanswered: Return earliest date only

    Hi,

    I have an SQL query that returns multiple dates and I wondered if there's anything I can add to the query that will make it just return the earliest date only

    Code:
    select expirytime from lvscharge c where (c.chargenr = (select hvgb_batch from hvgebinde g where g.hvgb_gebindeid = '5'))

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Code:
    select Min(expirytime)
       from lvscharge c
       where (c.chargenr = (select hvgb_batch
          from hvgebinde g
          where g.hvgb_gebindeid = '5'))
    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  3. #3
    Join Date
    Nov 2008
    Posts
    8
    Thanks Pat,
    As you can probably tell I know pretty little about SQL. Thanks for this, works a treat.

Posting Permissions

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