Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6884075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:27:45+00:00 2026-05-27T05:27:45+00:00

The following are available aggregate functions for SQL AVG() – Returns the average value

  • 0

The following are available aggregate functions for SQL

AVG() - Returns the average value
COUNT() - Returns the number of rows
FIRST() - Returns the first value
LAST() - Returns the last value
MAX() - Returns the largest value
MIN() - Returns the smallest value
SUM() - Returns the sum

I need to apply aggregate function on datetime field? It is not listed there. Max(), Min() will not work. What I would need is either

  • return the latest date
  • return the earliest date

Is it possible. Can I implement it somehow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:27:46+00:00Added an answer on May 27, 2026 at 5:27 am

    min() and max() work fine with dates

    you can also do

    latest

    select top 1 *
    from Table
    order by SomeDate desc
    

    earliest

    select top 1 *
    from Table
    order by SomeDate 
    

    BTW SQL Server does not have the first() and last() functions

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following available: last reported lat,lon w/timestamp target lat,lon estimated time to
Currently I do the following to listen on any available port on all interfaces:
Is there any code or custom options available to achieve the following : 1>
Are there any decent examples of the following available: Looking through the WIF SDK
Whether the download available in the following location include Service Pack 1 for Visual
The following code only works when the copy constructor is available. When I add
I'm following the example of code available in: http://www.openssl.org/docs/crypto/sha.html# After the following: EVP_DigestFinal_ex(&mdctx, md_value,
I have the requirement to access the following data, where available, on mobile phones
lets say i have the following GET variables available: state city bedrooms bathrooms type
Consider the following example (also available here: http://jsfiddle.net/hq8Fg/1/ ). It works fine in IE9,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.