Thanks vbSprgrmr,
I searched this site for Backup but not compression. Hopefully I will be able to find some code which I can incorporate in my app.
I have error handlers in place for the errors. When the app terminates, I call a backup routine which uses the CompactDatabase of JRO. In this...
Hello Tek-Tips,
My app currently uses the JRO.JetEngine CompactDatabase method to backup my Access 2002 database. I have two concerns.
1. My first concern is that when by db gets too large to fit on the removable media, it will not allow the file to span multiple disks.
2. My second concern...
shirverb,
Thank you for responding. Maybe I did not word my question properly. I wanted to create input variables within my SQL statement to be used withing the SELECT Statement. I am writing a SQL statement that will require several input variables in order to retrieve the requested results...
SkipVought,
Thank you for responding. I dug a little further and found what I am looking for. Access has a Parameters keyword used to define input parameters. The syntax for this question would be:
PARAMETERS @Date1 DATE, @Date2 DATE;
SELECT Revenue FROM MyTable WHERE Date BETWEEN @Date1 AND...
Hello Tek-Tips and thank you again for taking the time to read my question. Is there a way to declare a variable in a SQL Select statement which will allow me to assign through VB6. I am generating a SQL statement which uses 4 dates as parameters. However these 4 dates are needed several times...
rac2,
Man, I tried the JOIN thing before messing with Duane's code and could not get it to work. I can follow your statements easier then Duane's and wanted to use your's. I made some modifications to the Queries and you SQL and came up with this which gives me the correct results.
SELECT...
...MarketSegments.MarketSegmentName, MarketSegmentTypes.MarketSegmentType, sum(abs(RevenueDates.RevenueDate=#4/19/2004#)*RevenueDetail.Rooms) AS RoomsToday, SUM(Abs(RevenueDate=#4/19/2004#)*RevenueDetail.Revenue) AS RevenueToday, SUM(Abs(RevenueDates.RevenueDate Between #4/3/2004# And...
dhookom,
Man I really appreciate your help with this. We are almost there. I made some minor modifications to your code, just missed some "(", got some Syntax errors. I fixed them and the MTD total are correct...yea...However the RoomsToday are all 1 and the RevenueToday for all is 0. How can I...
Yes, it should return 9 rows, I simlified the SQL statement for my question. I typed your SQL statement as you have it and it returns 1 as RoomsToday. Here is my statement:
SELECT RevenueDetail.Rooms, RevenueDetail.Revenue, MarketSegments.MarketSegmentID, MarketSegments.MarketSegmentName...
rac2 and khookom,
I tried both statements I get the correct results using rac2's approach, however, I should recieve 9 rows and I get 81, a cartesean join. dhookom, I see where your code is going, however I must sum the Revenue and Rooms fields and I do not see these field names in your SUM()...
Thank you rac2 and dhookom, I will try out both SQL statements and I will post my results when I get it to work.
Sorry it took me so long to respond, I was out of the office.
Thanks Again!
Tom (maxflitom)
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...
Golom,
Thanks for the post. I have been a little out of it for a few days which is why it has taken me so long to reply. I will let you know how it works.
Thanks Again!!!
Tom (maxflitom)
...of my database:
Events Table: (one Event to many EventDetail items)
MeetingRoomPrice + Grat7 + Grat11 + SalesTax
EventDetail Table:
Quantity * Price
Output:
Customer1 12,100.25
Customer2 8,412.35
Here is a sample of a Union Select statement which returns the correct results...
...which returns the correct results, however, there are two results and not one.
SELECT Customers.CustomerName, IIf(ISNULL(Sum(EventDetail.Quantity*EventDetail.Price)),0,Sum((EventDetail.Quantity*EventDetail.Price))) AS Total
FROM (Customers INNER JOIN Events ON...
golom,
We are almost there. The only issues I have are in your SQL, I had to add the Events.EventID to the Group By. When I do this, instead of getting just one total for each customer, I get the same number as there are items in the EventDetail Table. I tried some variations and still cannot...
johnwm,
I have already attempted that route. All I want my report to accomplish is a list of customers and the total spent within a date range. If I can accomplish this in one SQL string, it seems that it would be the most efficient.
Tom (maxflitom)
JeffTullin,
Sorry I should have been let you know what I needed it for. I am using VB6 and wish to generate a DataReport using the Data Report Designer.
Didn't want to make my question longer than it should have been,
Tom (maxflitom)
...in the Events Table and could be many in the EventDetail table Here is my SQL string:
SELECT Customers.CustomerName, sum(EventDetail.Quantity*EventDetail.Price+Events.MeetingRoomPrice+Events.Grat11+Events.Grat7+Events.SalesTax) AS EventTotal
FROM (Events INNER JOIN Customers ON...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.