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
Windows 2000 Server strange shutdown/startup problem
MFC VersionInfo problem
Cannot boot Windows 7 after motherboard installation
Using XIRR in ACCESS , SQL TO VBA Conversions , Getting Runtime Error 1004
Refresh, acCmdSaveRecord - Current Record Pointer
Microsoft Word doc only show important text when "non-printing characters" is on
Need help getting started with n-tier design in asp.net 3.5
I am copying 40 diferent databases to a directory that these databases already exists. How do I prevent the system message "This Directory already exist" "Overwright" "Yes" "No" from appearing each ti
Change exchange account email display name
Arrays into Crystal Reports