If a date is assoiciated with the status you could sort by status and date, get the record count and grab the recordcount-1. Or get the last record and use the function 'previous record' to rewind.
Hope this helps,
Gerald
Dodge,
Thanks for the try but same result as the 'and' function. No records are returned. I have looked at the data in the table and know that "Status" has other than P or M in it. I have also tried the IsNull and IsEmpty.
Thanks
I have a field named Status in a table. It is defined as "text", 1 character, and default "". Validation rules are must be "" or P or M. Required set to "No', Zero Length set to "Yes". I am trying to pull all records that are not equal to P or M...
Cosmo,
As I said that worked great for the sums. Now the percent calculation don't work. Is it because there isn't a value in the 1, 2, 3, 4, or 5? This is the caculation I use:
=Sum[1]/(Sum[1] + Sum[2] + Sum[3] + Sum[4] + Sum[5])
Thanks
Erich,
The SQL would be:
Enter the Start Date You Want] AS ReportDate, [Enter the End Date You Want] AS EndDate
This prompt the user to enter the date and also would include the dates in the table you create from your first make table query. Then you would use that table for the crosstab...
Erich,
Does the first query write the data to a table that the crosstab query is using. I had a similiar problem and just wrote the start and end dates to the table when the first query is ran. Then you can use the dates as row heading and include in your report.
Gerald
im,
Depends on how many steps you want to do it in. You could first put all the data in a new table and then run a query against that table using the SQL 'select distinct' to get all the unique vendor IDs and put those in a separate table, loop through until you have no more vendor numbers...
I have a form that the user selects the report/query/form they want. If the button kicks off a query is there a way to supress the 'The table will be delteted......', You are about to paste.......', or other message the user must respond to. I have tried sendkeys without much luck.
Thanks,
Gerald
I have a cross tab query to change the class to 1, 2, 3, 4, or 5 based on the age of the invoice. It is an aging report if you know what I mean.
SQL for Crosstab:
TRANSFORM Sum([InvoiceAmount]-[SumOfInvoiceAmount]) AS ClassInvoiceA
SELECT AllExceptPD.ReportDate, AllExceptPD.ServiceCenter...
Joy,
I have a form that the user uses which has the command button to email the reports. All of the Vb code above executes on the 'on click' event. I want the user in input the start and end date once on the form if possible and then loop through the table to create and email each service...
Try this:
Dim strEmail As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
'Email Reports
With MailOutLook...
I have the following code working, probably not the best but my first time in VB. This runs a query, makes a table, writes the report to disk, opens the table and checks for up to 5 eamil addresses, then emails the report as an attachment. This worked fine until the user decided they didn't...
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.