You'll need to write another query to return the max test date for each student then join this into your existing query (qry_rpt_studentregistered1) or in the SQL above to limit the rows returned, eg:
qMaxDates:
select sutdentID, max(testDate)
from myData
group by studentID Best Regards,
Mike
You should use transferspreadsheet rather than transfertext but unfortunately you can't specify a range with this method when exporting :-)
If its an option it might be better to pull the data from the excel side. you should be able to control where the data ends up this way. Best Regards,
Mike
I don't think you can do this in one go. You need to write 3 queries, one each to count the rows in the 2 tables and a third to do the division, ie:
Q1: select count([Visit No]) as Visits from tableA
Q2: select count([Test Drive No]) as Drives from tableB
Q3: select Drives/Visits as myRatio...
You could try it a different way. Add a (hidden) column to your query as Month(myDate). In your combo box just put 1,2,3,4 etc in the secound column, ie col(1). Then use the
same syntax for your criteria line:
[Forms]![frmReportDept]![2ComboMonth].[Column(1)]
Out of interest don't you need to...
Tekila
The
[CSRName]= '" + Me.agentselect + "'"
part is a where clause applied to the results of the reports underlying query. Best Regards,
Mike
I think your problem is that you have not defined a value when PPDepPaid is false, in this case you iif returns NULL and if you try to sum across a mix of nulls and numerics you will get NULL. Try this:
=IIf([PPDepPaid]=-1,[ParkingDepositPrice],0)
and then in the footer...
Short answer, you can't. Not that I'm aware of anyway. When you need this you have to do it in two steps.
Q1:
select distinct colname from x
Q2:
select count(colname) from Q1 Best Regards,
Mike
Try this:
Private Sub byAgent_Click()
If IsNull(Me.agentselect) Then
MsgBox "Please choose an agent"
Else
DoCmd.OpenReport "printevalbyagent", , , "[CSRName]= '" + Me.agentselect + "'"
End If
End Sub Best Regards,
Mike
You'll need to do this in a module. Write a query that returns the criteria you need to define each report (maybe just customer number in your case). Process this result set
in a loop and open up a report for each customer. You can use the customer number to set the where clause when you open...
I couldn't see you snapshot but I'd guess that you have all your controls in the detail section. Pull all the common controls (eg customer id, name address etc) into the report header section and leave the order specific stuff in the detail (eg part number, quantity, price). Best Regards,
Mike
Well, in your query you can refer to the currently selected value in the combo box or you could bind the combo box to a (temp) table and join to this in your query to get the appropriate data. Best Regards,
Mike
Not sure exactly what you have so far but I think maybe in the change event for the combo box you need to open your report, eg:
Private Sub Combo1_Change()
DoCmd.OpenReport "myReport", acPreview
End Sub Best Regards,
Mike
Dave
Interesting problem.... I don't think there's an easy way to do this - you'll need to write some code in the report module. I had a fiddle and the code below will do your page totalling and will work for simple reports. Your grand total you can do with a regular sum control.
Hope this...
You can limit the result returned by a query using the top values property. I've added an order by clause so that you get the top 5 amounts:
SELECT TOP 5 Codetable.code, Count(CodeTable.Code) AS Count, Sum(CodeTable.Amount) AS TotalAmount, Avg(CodeTable.Amount) AS AvgAmount
FROM CodeTable
GROUP...
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.