DLookUp, Dates And Grouping Data
Jun 10, 2007Hello!
Is it possible to group data in form from table within two dates with aggregate function DLookUp,
Thanx
Hello!
Is it possible to group data in form from table within two dates with aggregate function DLookUp,
Thanx
I have a query which has many sums and counts on things like "Company name", "region name" and "Development Name".
I'm using this query for a report to do lots of percentages with, but now i need to filter this also by a date period.
So the user choses "Alex Homes" as the company name and then "July 2006" as the reporting month, and i need all the sums and counts to stay the same and only count/sum the records in the chosen month.
I can't seem to think of a way to do this.
If you need more info then ask.
Hello, I am new to Access and I am having a problem with something. I have a query which returns, among other things, dates. I need to organize (group) the dates into weeks. Does Access have a function which could do this? Or some other way of grouping the dates? Or How would I got about writing a function in Access?
This is done in a Pivot Table right now, and I just use a calculated field which is the date / 7. This gives some god awful numbers (like 5944), and not anything like what I want. I would want the function to return something like,
"Feb. 5, 2005 - Feb. 12, 2005". Any suggestions?
I am working on a very large table that i have to group by Min & Max Dates.
ColumnA ColumnB
1-Jan Melbourne
2-Jan Melbourne
3-Jan Melbourne
4-Jan Melbourne
5-Jan Sydney
6-Jan Sydney
7-Jan Sydney
8-Jan Sydney
9-Jan Sydney
10-Jan Sydney
11-Jan Sydney
12-Jan Melbourne
13-Jan Melbourne
14-Jan Melbourne
15-Jan Melbourne
I want the above table to provide an output as below:
Min Max City
1-Jan 4-Jan Melbourne
5-Jan 11-Jan Sydney
12-Jan 15-Jan Melbourne
i have done this in excel by sorting dates and then comparing values in Column B.
I am trying to Dlookup two fields with dates in them. If the Dlookup returns that today is in the range (e.g. 06-03-2015 in the first field and 10-03-2015 in the second) then i want the system to display a messagebox when im opening up a form. If today is not in the range then the messagebox should not pop up.
Code:
If DLookup("HollidayFrom", "tblBuildingManager", "[HollidayFrom] >= Date()") And DLookup("HollidayTill", "tblBuildingManager", "[HollidayTill] <= Date()") Then
msgBox "A building manager is on holliday"
end if
The table looks like this :
BuildingManager
ManagerID
Phone1
Phone2
Phone3
HollidayFrom
HollidayTill
George Bush
1
06-11111111
06-11111112
06-11111113
1-4-2015
9-4-2015
Bill Clinton
2
06-22222222
06-11111114
06-11111115
30-8-2015
19-9-2015
Can't figure out why dlookup will not work for me in a query for certain dates?
Simple example to highlight the problem:
Table1 -
Read_Date----Read_Value
31/07/14-------10
01/08/14-------20
03/08/14-------30
20/08/14-------40
Query based on this table with the following calculated field:
Expr1: DLookUp("[Read_value]","Table1","Read_Date=#" &[Read_Date]& "#")
Query output -
Read_Date-----Expr1
31/07/14--------10
01/08/14
03/08/14
20/08/14--------40
Will not return a value for 01/08/14 or 03/08/14 (dd/mm/yy)
If you try it with many dates its skips several and I cannot see a pattern.
How do i group the following records
ID Surname Pack
29679Minican 1
29679Minican 2
27818Oliver 1
27818Oliver 2
27818Oliver 3
so its will show ...
27818Oliver
29679Minican
... on a spreadsheet
I have a table which stores meeting room booking information in half hour slots.
If someone books a 2 hour meeting then 4 records would be produced – one for each half hour. I want to produce a query which will group the data by room (ScheduleID) showing the max and min times (ie the initial start time and final end time) for each event and the event details. The table structure is as follows
ScheduleDetailsID, ScheduleID, CustomerID, ScheduleStartTime, ScheduleEndTime, meeting purpose
And the query I have tried is as follows:
SELECT [Schedule Details].ScheduleDetailsID, [Schedule Details].ScheduleID, [Schedule Details].CustomerID, Min([Schedule Details].ScheduleStartTime) AS MinOfScheduleStartTime, Max([Schedule Details].ScheduleEndTime) AS MaxOfScheduleEndTime, [Schedule Details].[meeting purpose]
FROM [Schedule Details]
GROUP BY [Schedule Details].ScheduleDetailsID, [Schedule Details].ScheduleID, [Schedule Details].CustomerID, [Schedule Details].[meeting purpose];
Can anyone tell me where I have gone wrong. It does not group the data as I want it to ie by room, then time, with only the initial start and final end times. Thanks in advance. Peter
Hi, Last piece of advice i got from here was excellent so thought i would try it again,
I have records that show delivery days and postcodes some post codes have more than 1 item going to them on several days through the week i was wondering if i could group the same postcodes together so it only showed 1 record instead of a possible 15 but only those delivered on the same day, Is this possible?
Hi all,
I currently have a table that holds 2 months of data. Let's just use January/February 2004 as an example.
The field name is [DateReceived] and goes from '1/1/2004' to '2/29/2004'. I need to group my records in 7-day spans for a future query, so anything from 1/1 to 1/7 would be grouped, etc.....
I have no idea how to do this. Any help would be great.
sanctos
G'day,
Putting together some data access pages to display data from tables.
All is good except a property that I do not like, when there are multiple records in the returned recordset from the query to the page, I have grouped these by ID (for example).
Each time you move to next record the display contracts back to just the top level of display, that is with the the ID number displayed in a text box and a "+" to expand it out to see the details of the record under that group.
I would like have it always expanded to show the details of the records as I scroll though the ID numbers (the top level of grouping), rather than having to expand for each ID number to see the details.
Not sure that is clear, but any ideas..........
Hi All,
I have two tables
Table A
EmpID EmpName
001 Will
002 Jack
003 Emma
004 Greg
Table B
EmpName EmpHobby
Will Sport
Jack Reading
I wanna join the two table by using query so the result will be
EmpID EmpName EmpHobby
001 Will Sport
002 Jack Reading
003 Emma (blank)
004 Greg (blank)
what query should I write
Kindly need your help,i am frustrating with this
I have a list of customers, with Account Numbers and Company Names. Now I have entered a combo box in my form control with a list of Account Numbers, how ever I wish to group these Account Numbers because some are the same, with the same company but a different Employee.
So how do I group Account Numbers within the combo box?
I have a database with a list of clients. One field is for their date of birth.
I have to report on equality and need to know how many clients we have within the following age groups:
16 - 24
25 - 34
35 - 44
45 - 54
55 - 64
65+
I have looked through the group and sort functions and cannot see anything obvious.
i have a filter that shows the bookings for the weekend, which i can click on each act and it generates an email for then to confirm. however some acts have more than one booking on that weekend and i want to be able to list the bookings in one email, the email script i use at the moment is below, the acts can be grouped by a field called grouped
Code:
Private Sub artist_DblClick(Cancel As Integer)
Dim msgTxt As Variant
Dim objOutlook As Outlook.Application
Dim objMailItem As Outlook.MailItem
[code]....
I am trying to create a query that will group my data by each week so I can sum up some numbers and display them on a per-week basis... Prefer the week to start on Sunday but really not picky about it.
Using the following in the query design window.
Week of Year: Format([Date],"ww")
This is returning:
1
10
11
12
2
3
4
and so on.. See the problem?
I tried sorting but that doesn't work.
I also tried the following:
Format([Date],"mmmm,ww")
But this is returning
December,51
December,52
February,8
February,9
January,1
January,2
January,3
Yes, there are some weeks without data but that's not the problem. The issue is that its putting February before January.. Why is this? Again, I tried sorting options and several other techniques but no success.
I have a master table which shows all transactions per record (person) over a financial year.
Each record person has a seperate package period over which their spend needs to be measured. Therefore although I have all their transactions for the year, I only want to sum their transactions between their given [start date] and [end date] which are in columns.
I need to be able to create a field which sums all expenditure per record between the start and end dates
Name Start Date End Date Invoice Date Amount
Matt 15/5/11 15/9/11 1/11/11 £100
Matt 15/5/11 15/9/11 7/7/11 £200
Matt 15/5/11 15/9/11 12/12/11 £200
In this case I would only want to sum 7/7/11 as this is between the start and end dates
I want to write something like sumif([Invoice Date] is between [start date] and [end date] - not sure where or how exactly
(The start date and end date will always be the same per person)
Is this possible in access?
Grouping a report data starting from date 01.04.2013 to 31.03.2014 ??
View 2 Replies View RelatedI'm trying to group data in a report from single table using grouping and sorting and I want the percentile of every record over group total. I'm using a query to fetch data from table, however I'm unable to get percentage of every single record over group total.
I want to display the report as attached image in single report. I'm unable to get data in "Perc" field. It's populating wrong values.
I have a table with application records. One of the fields captures schools the applicant will work at. This field stores data in comma delimited format. There could be 1 school name; there could be 5 school names.
My ultimate goal is to build a report which shows me records of all applications, grouped by school choice. I want to see: School A was selected by 5 people, School B was selected by 7, etc.
Is it possible to write a query from this table that will enable this?
I have a continuous subform which has a DLookup to pull a calculation from a query, what's the best way to get the field to refresh every time a record is updated (via a pop up window).
View 1 Replies View RelatedI am facing issue with DLOOKUP,
Actually the program flow is like i have a table of 25 fields, ID as PK and item name, item code and remaining is the date as field name,
Below mentioned is the Table headings,
"ID" "Item Name" "Item Code" "10/29/2013" "11/5/2013" "11/12/2013"
Problem is that when im doing dlookup on date getting wrong result...
This is what I am using in my codes.
DLookup("11/12/2013" , "tbl_Name", "ID = " & rs.Fields("TRANSID") & "")
Hi
I am building a forecasting database that will have known amounts entered for various projects. If a project has no known future amount (lets say for next March), I want my query to calculate a projected number by taking the most recent equivilent month (for this last March,which may be a number or even zero) and applying a growth factor.
I thought to use Dlookup in this way, but it is not working:
Amt: IIf(IsNull([Amount]),DLookUp([amount],"data_table",DateAdd("yyyy",-1,[data_table]![date])=[data_table]![date])*[growth],[amount])
I have created "placeholders" for the non-existant months in a prior query (i.e. this formula should replace null cells w/ projected values only if there is no actual value)
I would appreciate any suggestions very much!
thanks
How do you refresh all of the data on a form when the tables that are the source for dlookup fields on the form are changed by command buttons on the form?
View 1 Replies View RelatedI am trying to get my VBA module to find the ID of a Member Number from a table using a dlookup but I keep getting a data type mismatch error,
Code:
Dim Answer As String
Dim varX As Variant
Dim rst As Recordset
Dim strSQL As Integer
Dim stWhereStr As String
Set db = CurrentDb()
[Code] .....
In the table the ID field is an automatic number and the Member Number is a short text field.
My intentions are to get my combo box to display data into a field in my form, when it is changed/selection is made. So far my form has the following:
Combobox: CBOCharacters
Field: CharacterGender
Both of these are in the same table; tbl_Characters. The data type for CBOCharacters is a number and its called CharacterID in the table.
So far I have created this piece of code:
Private Sub CBOCharacters_AfterUpdate()
Me.CharacterGender = DLookup("CharacterGender", "qry_StillNeeded", "[CharacterID]= " & Me.CBOCharacters)
End Sub
When I run this event procedure i get an error:
Runtime error '2471'
The expression you entered as a query parameter produced this error '[CharacterID]'