I didn't look at Pat's sample, but a function like this could be used for customizing the output format.
Function TimeSumString(ByVal hrs As Long, ByVal mins As Long) As String
TimeSumString = Format$(hrs + mins \ 60, "00") + ":" + Format$(mins Mod 60, "00")
End Function
The WhereCriteria should be a legal Where expression of a query without the word where. If your'e using text fields in your expression each value must be surrounded by a pair of '. I. e. "[Computer]='" & Me![computer].Column(2) & "' AND "
Dim strWhere As String
strDocName = "report1" 'Report...
There might be different ways to set the right query for your report. You can use a public variable in a global modul or lookup at a control value in the report's open event. Some Access-Version (AXP, A2K?) have the OpenArgs argument in the OpenReport method.
By using a global variable you...
I just set up a table instead of your query, also I didn't use a criteria for the year. With only one record in qryTally I got the following result
Month Total FR IAR EAD
January 1 1 0 0
February 0 0 0 0
March 0 0 0 0
April 0 0 0 0
May 0 0 0 0
June 0 0 0 0
July 0 0 0 0
August 0 0 0 0
September 0...
Maybe you can set up the combobox in the Load Event of the form with the following procedure.
Sub SetLast52Weeks(CboCtl As Access.ComboBox)
Dim strRowSource As String
Dim i As Integer
Dim dtThisWeek As Date
' assuming week starts on Sunday...
I think that the information of the query is not sufficient to be able to get a clear picture of your table structure. Maybe You explain to us how the involved tables stand together in relation.
This query shows one way to accomplish the goal.SELECT
T.ADDRESSID
, T.DATEFIELD
FROM YourTable AS T
WHERE T.DATEFIELD = (
SELECT
Max(DATEFIELD)
FROM YourTable
WHERE ADDRESSID = T.ADDRESSID)
Hi Nilses,
you could try setting a Where clause in your crosstab query. I.e. WHERE G.Type Is Not Null and remove the Nz function around the type field.
Because of the outer join you could receive Null values in type, for which Access will use <> in the column heading. You could set fixed column headings in the crosstab query or use the Nz function, for returning an appropriate value in case of an empty field.
TRANSFORM...
you could try this querySELECT TOP 1
[month]
, [year]
, [date]
, [location #]
, sales
FROM YourTable
WHERE [date] Not In (
SELECT TOP 1
[date]
FROM YourTable
ORDER BY [date] DESC)
ORDER BY [date] DESC