Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select records grouping by day (not date) but also the empty ones..

Status
Not open for further replies.

jonasggg

Technical User
Sep 30, 2003
12
0
0
UY
hello
I need to list records grouping by day but also the ones wich day didnt have movement. For example:
August:
day - Total
1 - 5000
2 - 0
3 - 2000
4 - 0
until 31

Thanks in advace!
 
Do you mean grouping or ordering? What do you want to do? Can you post some data and what you want the output to look like.
 
Sorry I meant ordering but also is grouping because in total field it needs to be sumarize
for example Incomes for August:

Day - Total
1 - 100$ <- sum of invoices on day 1
2 - 0 $
3 - 120 $
 
Ok, now, how is your day column defined? Is it a date time column, or some other type and how is the month, day, year stored?
 
The day column is a datetime field.
01-08-2005 10:00:00 (august 1rst)


 
Select <datecol>, Sum(<quantity col>)
From <table>
Group By <datecol>
Order by .. what ever you want
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top