Hello Tek-Tips,
My question today is I wish to extract info from a Table (Access 2002) called (RevenueDetails) which includes the Fields (Rooms) and (Revenue). I wish to display today's Rooms & Revenue and month to date Rooms & Revenue in one statement. I am having some difficulty doing this can anyone help?
Example Output:
Today MTD
(Rooms) (Revenue) (MTDRooms) (MTDRevenue)
5 100.25 100 1000.25
I am not sure how to use the SUM(Revenue) & SUM(Rooms) on the same line as my select statement and have the WHERE criteria different?
SELECT Rooms, Revenue FROM RevenueDetails WHERE RevenueDate = #4/20/04#
SELECT SUM(Rooms) AS MTDRooms, SUM(Revenue) AS MTDRevenue FROM RevenueDetails WHERE RevenueDate BETWEEN #4/01/04# AND #4/30/04#
Any suggestions are greatly appreciated.
Tom (maxflitom)
My question today is I wish to extract info from a Table (Access 2002) called (RevenueDetails) which includes the Fields (Rooms) and (Revenue). I wish to display today's Rooms & Revenue and month to date Rooms & Revenue in one statement. I am having some difficulty doing this can anyone help?
Example Output:
Today MTD
(Rooms) (Revenue) (MTDRooms) (MTDRevenue)
5 100.25 100 1000.25
I am not sure how to use the SUM(Revenue) & SUM(Rooms) on the same line as my select statement and have the WHERE criteria different?
SELECT Rooms, Revenue FROM RevenueDetails WHERE RevenueDate = #4/20/04#
SELECT SUM(Rooms) AS MTDRooms, SUM(Revenue) AS MTDRevenue FROM RevenueDetails WHERE RevenueDate BETWEEN #4/01/04# AND #4/30/04#
Any suggestions are greatly appreciated.
Tom (maxflitom)