Click here to Skip to main content
16,005,241 members
Home / Discussions / Database
   

Database

 
GeneralRe: DataSet query Pin
Shaun Wilde12-Feb-03 1:26
Shaun Wilde12-Feb-03 1:26 
GeneralRe: DataSet query Pin
Bruce Duncan12-Feb-03 7:04
Bruce Duncan12-Feb-03 7:04 
GeneralRe: DataSet query Pin
Shaun Wilde12-Feb-03 22:12
Shaun Wilde12-Feb-03 22:12 
GeneralRe: DataSet query Pin
Bruce Duncan13-Feb-03 7:12
Bruce Duncan13-Feb-03 7:12 
GeneralColumn number in SELECT Pin
Mazdak11-Feb-03 23:08
Mazdak11-Feb-03 23:08 
GeneralRe: Column number in SELECT Pin
andyharman11-Feb-03 23:31
professionalandyharman11-Feb-03 23:31 
GeneralRe: Column number in SELECT Pin
Mazdak12-Feb-03 1:05
Mazdak12-Feb-03 1:05 
GeneralUsing Group By Properly Pin
perlmunger11-Feb-03 18:55
perlmunger11-Feb-03 18:55 
I'm working on a video rental system. I have a table of data that looks something like this:

DateRented	        RentalType
----------------------- -----------
11/11/2002 11:21:47 AM	VHS
11/11/2002 11:44:28 AM	VHS
11/13/2002 11:37:05 AM	VHS
11/13/2002 10:54:14 PM	DVD
11/14/2002 2:57:58 AM	DVD
11/14/2002 2:58:31 AM	DVD
11/14/2002 3:39:19 PM	DVD
11/15/2002 10:38:32 AM	VHS
11/15/2002 10:49:06 AM	DVD


What I need is a query that will return three values--the date in question (day only), a count of all items that were rented, and a count of all DVDs that were rented. I have tried using the GROUP BY clause, but I can't seem to get it right. See, I don't care about the time in the date field. I just want a count for all items and DVD items for a particular day. So my output should look like this:
DateRented     TotalRentals    DVDRentals
-------------- --------------- ----------
11/11/2002     2               0
11/13/2002     2               1
11/14/2002     3               3
11/15/2002     2               1


Thanks in advance.

-Matt

------------------------------------------

The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
GeneralRe: Using Group By Properly Pin
Richard Deeming11-Feb-03 23:44
mveRichard Deeming11-Feb-03 23:44 
GeneralRe: Using Group By Properly Pin
andyharman11-Feb-03 23:45
professionalandyharman11-Feb-03 23:45 
GeneralRe: Using Group By Properly Pin
perlmunger12-Feb-03 2:54
perlmunger12-Feb-03 2:54 
GeneralRe: Using Group By Properly Pin
andyharman12-Feb-03 4:27
professionalandyharman12-Feb-03 4:27 
GeneralRe: Using Group By Properly Pin
perlmunger12-Feb-03 6:03
perlmunger12-Feb-03 6:03 
GeneralRe: Using Group By Properly Pin
andyharman12-Feb-03 23:51
professionalandyharman12-Feb-03 23:51 
GeneralRe: Using Group By Properly Pin
perlmunger13-Feb-03 5:18
perlmunger13-Feb-03 5:18 
GeneralRe: Using Group By Properly Pin
andyharman13-Feb-03 6:18
professionalandyharman13-Feb-03 6:18 
Generalexception when call (recordset.open "select * from db where ID='aa'") Pin
rxl11-Feb-03 5:57
rxl11-Feb-03 5:57 
GeneralRemote DataSet Pin
Amir Harel10-Feb-03 22:13
Amir Harel10-Feb-03 22:13 
Generaltrouble concatenating a SQL string that returns @token on-the-fly. Pin
devvvy10-Feb-03 21:39
devvvy10-Feb-03 21:39 
QuestionHow connect ADOX to Excel? Pin
Anonymous10-Feb-03 18:14
Anonymous10-Feb-03 18:14 
AnswerRe: How connect ADOX to Excel? Pin
andyharman12-Feb-03 4:45
professionalandyharman12-Feb-03 4:45 
QuestionCan anyone give me an example of these SQL statements?? Pin
IrishSonic10-Feb-03 12:01
IrishSonic10-Feb-03 12:01 
AnswerRe: Can anyone give me an example of these SQL statements?? Pin
Alexander Kojevnikov11-Feb-03 6:42
Alexander Kojevnikov11-Feb-03 6:42 
GeneralRe: Thanks Alexandre Pin
IrishSonic12-Feb-03 10:16
IrishSonic12-Feb-03 10:16 
GeneralDatabase Design Pin
Mark Sanders10-Feb-03 11:52
Mark Sanders10-Feb-03 11:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.