473,387 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

probably an easy one - 2 agregate functions

Struggling to write this script:

DESCR TYPE SELL StartDate EndDate Number
65048 04 Price A 4/21/2004 4/26/2004 35456
65048 06 Price C 4/20/2004 4/27/2004 35459
65048 08 Price B 4/22/2004 4/28/2004 34559
65049 04 Price A 4/19/2004 4/24/2004 38595
65049 06 Price B 4/22/2004 4/25/2004 38594
65049 06 Price C 4/20/2004 4/29/2004 38998
65050 07 Price A 4/21/2004 4/25/2004 38112
65050 06 Price B 4/18/2004 4/28/2004 38550
65050 07 Price C 4/17/2004 4/29/2004 38110

Descr, Type, Sell and Number are CHAR
StartDate and EndDate are SmallDatetime

I need a simple query that would display the records with the following
criteria:

#1. "Date I Enter" >= Startdate
#2. "Date I Enter" <= Enddate
#3. Highest TYPE for each DESCR
#4. Highest NUMBER for each TYPE/DESCR (the tie-breaker)

Results for ("Date I Enter" = 4/23/2004) should be:
65048 08 Price B 4/22/2004 4/28/2004 34559
65049 09 Price C 4/20/2004 4/29/2004 38998
65050 07 Price A 4/21/2004 4/25/2004 38112

I REALLY appreciate the help!

Thanks!!


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 20 '05 #1
0 1415

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Nick Dreyer | last post by:
In VB.NET I would like to not have to create property get/set procedures for every class variable I want to expose to Excel VBA projects in COM builds. Can anyone tell me if that is possible, or...
2
by: kids_pro | last post by:
Hi there, I think it is a stupid idea but I wonder since dataset is a disconnected datasource. Why not all some more functionality to it like SUM, AVG, MIN, MAX when? So that we don't need to...
1
by: Mad Scientist Jr | last post by:
can someone explain how to simply populate a grid in .net ? the way i understand it, there is no more msflexgrid, and instead is this new control that has to be tied to a dataset, and it is a real...
1
by: Mad Scientist Jr | last post by:
can someone explain how to simply populate a grid in .net ? the way i understand it, there is no more msflexgrid, and instead is this new control that has to be tied to a dataset, and it is a real...
0
by: Yiyu | last post by:
Hi, I am a newbie here. Here what I want to do and I wonder if it's easy to be achieved using Windows Presentation Foundation: I am going to teach a college course and I want to do real time...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.