Microsoft
Software
Hardware
Network
Question : Group By Min(date) and Max(date)
How do I return the Min(date) and Max(Date) for a set of records. The date is as follows:
ID From_Date To_Date Dollar Number Code
3119 7/16/2009 8/14/2009 31854.86 0 001
3119 8/14/2009 9/15/2009 35150.32 0 001
The query should return the ID, Min(date), Max(date), Sum(dollars), Sum(numbers), Code. The result should look like this:
ID From_Date To_Date Dollar Number Code
3119 7/16/2009 9/15/2009 67005.18 0 001
Answer : Group By Min(date) and Max(date)
ed_j, i don't know what your where clause should be, but the rest could be...
select ID, min(From_Date) From_Date, max(To_Date) To_Date,
sum(Dollar) Dollar, sum(Number) Number, Code
from tablename
where
group by ID, Code
Random Solutions
Access 2003 Insert Query with data from form to multiple records
sql 2005 backup config
How do you test a dataset for the existance of a record?
Check folder and delete any files if older than one week
What is the best way in FoxPro to move or copy a file and preserve the original filename case?
Price of Development
Microsoft Front Page Forms ...
Print a Filtered SubForm
transfer Access 2003 using VBA to Access 2007 on another computer
SBS 2008 Console feature is not setup correctly - Unable to create users -