Queries :: Appointment Activity - Select Query For MAX Date

Jul 10, 2014

I need to find the frequency of client's appointment activity after their last appointment in a 4 month window.

My question is:
(1) Is my SQL going to give me the last time a client was in the office within the 4 month window?

(2) What will my SQL need to like to count frequency of appointments before and after window for each client?

(3) Can I do (2) in the same SQL shown above or will I need to make a new SQL statement?

Code:
SELECT tblTest.Client, Last(tblTest.AppointmentDate) AS LastOfAppointmentDate INTO tblTest
FROM tblTest
GROUP BY tblTest.Client
HAVING (((Last(tblTest.AppointmentDate))<#4/30/2014#))
ORDER BY Last(tblTest.AppointmentDate);

Details

Date Window I need to select the clients last appointment: Jan 1, 2014 - April 30, 201

Once the last appointment has been determined for each client in that window I need to count the frequency of appointments before and after that date.

View Replies


ADVERTISEMENT

Queries :: Select Query - Most Recent Date

Dec 24, 2013

How would you write a Select Query to select the most recent dates?

Select OrderDates
From Orders
Where >=Date()

No good if recent date is older than todays date!

View 3 Replies View Related

Queries :: Appointment Database - Query Most Recent Entry For Each Record In Separate Table

Jun 20, 2013

I have a database that is used to allocate appointments to our staff. It has 2 tables, one that lists the clients we need to call in that day, and another that stores details of each contact attempt. I'd like to design a query that find all clients who we have not dealt with so we can easily get their details in a list. I know what the criteria for the query would be, but I'm stuck for how to actually execute it. Here are the details.

Table tClients stores the current clients - primary key is named "clientRef"
Table tContactEvents stores each contact attempt and the date/time is stored in a field named "dateTime".

When an entry has been dealt with successfully a yes/no field named "completed" will be set to "Yes".

There may be many attempts to contact a specific client on a given day, unsuccessful attempts will not have the completed flag set.

Once the completed flag is set that client will be ignored so no further entries will appear.

So I need a query that searches tContactEvents for the most recent match to each number in tClients.clientRef and checks if the completed flag is set. If the completed flag is false, or if the number has no match (i.e. no contact attempts made yet) then the clientRef should be displayed. I also need this to be restricted to the current date, as the same client could have rebooked their appointment to a different day.

View 10 Replies View Related

Queries :: Query To Select The Date From Two Tables On The Criteria Basis?

May 21, 2013

get the data from two tables on the basis of criteria...

I want to select the whole table1 which has 6 fields including Emp_id...

I want to select the single field from table2. field name is "Username" from second table2. will select the username on the basis of Emp_ID becaue both tables has same emp_ID.

It should be in order like. Emp id, Username, Startdate, Enddate, Hours, trainingNames.....

View 1 Replies View Related

Attemptin To Show Latest Activity Date In SKU Database

Feb 21, 2007

Hey Guys & Gals, extreme newb here attempting to display the latest activity date in an SKU activity db in a query that spans 12 months with multiple activity dates on each of the 1,200 SKUS.

I have this so far and of course it only shows the last (DMAX) activity, not SKU related. How can I relate this result to each SKU to diplay the latest activity for each.

SELECT [Usage06-07].workorderDateClosed, [Usage06-07].qty, [Usage06-07].itemNo, [Usage06-07].Item
FROM [Usage06-07]
WHERE ((([Usage06-07].workorderDateClosed)=Dmax("workorderdateclosed","usage06-07","item")))
ORDER BY [Usage06-07].Item;



Thx in advance for your patience :)

Joe

View 2 Replies View Related

General :: Activity Log Database - Combo Box Queries

Oct 15, 2014

I've attached my database as I have it now. I am trying to create what amounts to an activity log.

I have created my main Subject and underlying related Issues tables, and a table for my daily activity notes. I have created my main form and subforms that should be sufficient (hopefully) for my purpose. Where I am getting hung up now is making the Subject and Issues fields combo boxes and filling them.

For the top-level Subject, I want to be able to type a new one in at any time, but also have the option to choose from a dropdown on the control as well. Then, if I do type one in, the next time I try to add a new record, it would appear in the dropdown as well. I think I have to query the underlying field to drive the dropdown list, but I cannot remember how to do that.

For the second-level Issue, there would also be a dropdown in the same way as the Subject control, and I want to be able to choose from the dropdown or add a new one in the same way... but I need to make sure that the ones that appear in the dropdown are related to the top-level Subject shown in the main part of the form. Of course, I don't want to be able to add an Issue unless it is related to a parent Subject. On these things, I am totally lost.

Finally, I built my notes to show in the subform as a continuous form, which I have used only once before. I'd like it so that the notes show newest at the top. And, I'm thinking about putting a "lock" checkbox on the note record so that I don't overwrite previous notes unless I consciously go back to edit something. I'm not sure how I can make an individual note dependent on an individual checkbox in the continuous form.

View 1 Replies View Related

Date: Display Next Appointment

Jan 12, 2005

Hello, I've searched the forums and all over the web, but I still can't figure out how to solve my problem.

I am creating a contact manager/scheduler. There are several tables in this database but the only ones that are involved with this problem are the following:

Contacts Table (main table stores all the contact info)

Meetings Table (stores all the meetings for all contacts)

The field relating the two tables is ContactID.

I have created a tabbed form allowing the user enter Contact Info, Meetings Info, Call History etc. Entering Meeting Info, is done on a subform and the subform will only display the meetings scheduled for the specific ContactID being modified. So everything works great.

What I am trying to accomplish now is to show the very next appointment for the specific ContactID being modified. Meaning if I'm editing/adding info for a specific ContactID, I would like to display above the subform (maybe in a textbox not sure) the very next meeting scheduled for that contact.

Currently the user can simply browse through the subform (meetings) for that Contact ID, and find the next meeting, but I think it would make it a lot more user friendly if the next meeting would be displayed automatically.

So what I am trying to figure out, is how to parse the Meetings table for the specific ContactId being modified and find a meeting date that is later then NOW() but is also the earliest date from now (hopefully this makes sense). If there is now such date, I would like to display "There is no scheduled meetings" (or something along the lines of that).

How can I accomplish this? Would be through a query?

Hopefully my explaination was clear, and I would appreciate any help, because I have really hit a road block...

Eric

View 5 Replies View Related

Queries :: Database For Log Activity - Delete Only Appended Records

Nov 3, 2014

I have a database that is used by managers to log activity of staff. We wanted to allow staff to write to the DB, but not allow them full access. We decided to accomplish this by adding a VBA function to an Excel sheet that they already use every day. It allows them to select a description, start time and end time and writes records to a database containing just 1 table.

The database used by the managers periodically runs an append query, and then a delete query to update with details of entries made by staff, and then clear the table to avoid duplicates during the next append.

I'm sure those of you with experience can already guess what's been happening and are shaking your head right now. It seems like entries made while the append query is running are being deleted when the delete query runs. So potentially I append 4 records, but delete 6 as 2 new entries were made before the delete query ran.

Is there a way to delete only the records that have just been appended? Or is there a more acceptable way of achieving this without using a delete query?

View 3 Replies View Related

Queries :: Display Start And Finish Time For Activity

Sep 18, 2013

I have a query that displays the start and finish time for an activity, I am trying to display the reults of the time between each activity....

For example
Name start End
aaa 14:07 14:09
aaa 14:11 14:12

The end time for the first activity was 14:09 and the next job was started at 14:11, so I want it to display 00:02: - (elapsed time)

Its very easy to do in excel as it would be =SUM(B2-C1) but haven't a clue how to do it in access.... is there any way?

View 3 Replies View Related

Zero Activity Query

Jan 9, 2007

I currently have 2 tables going:

Table 1: Customers
Fields: Account (join field)
First Name
Last Name


Table 2: Transactions
Fields: Account (join field)
Date
Payment (money that comes in)
Fee (invoice that is charged)


I need to find those customers that do not have any transactions (no payments, no fees) for a certain date period (ie entire month of January)

I have see "sql not exist", "minus", "outer join" for sql statements, but most of my work is in Access 2000.

Any help is greatly appreciated!!

Thanks ahead of time.

Leeann... :)

View 3 Replies View Related

Queries :: Select Query To Gather Results Of Other Select Queries

May 11, 2014

I'm fairly new to Access. 's various select queries containing useful and useless results. I want to create a select query that will pick out all the useful figures into a 1 row table that can then be pasted into Excel.

e.g Existing Select Query 1 returns 1 row showing Average Age, Average Price, Total rainfall
Existing Select Query 2 returns 1 row showing Average Weight, Average Salary, Total snowfall
Existing Select Query 3 returns *2* rows: It returns Distance from London, Hours daylight and population for Town A and Town B

I want a select query that returns 1 row showing (6 items):

Total rainfall, Total snowfall, Town A Distance from London, Town A Population, Town B Distance from London, Town B Population.

I've been able to handle getting Total rainfall and Total snowfall. But I cant figure out how to get Town A Distance from London, Town A Population, Town B Distance from London, Town B Population to appear in the same row of the same query results as Total rainfall, Total snowfall.

View 3 Replies View Related

Tables :: Appointment Date - Table Input Mask Error

Mar 28, 2015

I Have a field called appointment date and i have set the input mask as short date 00:00;0;_

the data type for the field is date/time but for some annoying reason this error message appear when I enter a date to the table... which for example is written like this 01/03/2003

I've attached the msg below ....

View 3 Replies View Related

Linking Outlook Calendar To MS Access - Appointment / Meeting Date And Time

May 30, 2013

I have linked a Shared Calendar from MS Outlook in MS Access. The fields that I need which are Appointment/Meeting Date and Time are not there, only creation date/time. Is there anyway for me to get the Appointment/Meeting Date and Time from Outlook into the table?

Windows 7
Office 2010

View 1 Replies View Related

Queries :: How To Select Records When Date Is Less Than 30 Days Apart

Mar 10, 2014

I have a large database filled with customer records. Some customers come one time. Other customers come 50 times at year. I want to find all customers that have records that are less than 30 days apart so I can ultimately see the types of products they buy. How do I write the query?

I attached a picture of a sample database. The 30 day (+/-) field doesn't exist but I would like the query results to build it.

View 11 Replies View Related

Queries :: Using A Form To Select Date Range

Jul 1, 2014

I'm using a form to select a date range. Using the following, and entering start date of 6/1/14 and end date of 7/1/14 I would expect to pull the records with a date of 7/1/14; however it doesn't. I have to enter and end date of 7/2/14 to pull 7/1/14 records.

>=[Forms]![F_Transaction_Date_Range]![txtStartDate] And <=[Forms]![F_Transaction_Date_Range]![txtEndDate]

View 14 Replies View Related

Queries :: Select Last Input From Several Date Columns

Oct 2, 2013

Having built a database that tracks projects across their lives, I've now been asked it I can identify the latest status of the project in a "quick view"

The table "All Projects" has columns that list the Project Number; Project Title; Project Manager and further colunms that list dates that the various stages of the project were achieved. i.e. Start Date; Date Milestone 1 Completed; Date Milestone 2 completed etc.

The projects are such that Milestone 5 may be completed before Milestone 2 and so on, so I need to be able to identify which Milestone was the last to be completed.

I thought of trying an IIF but the progress across the Milestones isn't logical so it won't work. I found something on the Internet about "Greatest" being used on some other program (not Access), which Access didn't like at all!

If the requirement had been given before starting building the db, I would have done everything differently, but I have no real desire to go back to stage 1 and start again, so how or if it's possible to find the highest / latest date relevant to the Project Number across the row of data ?

View 6 Replies View Related

Queries :: Select All Dates Since A Given Date Without Referencing A Table? (Access 2007)

Apr 23, 2014

Is it possible to create a query to select all dates from a given reference date? I don't mean all dates in a table - I mean all dates generally?

(The idea being to fill the first field in the resultant dataset with the list of dates, then run subqueries off that to fill the remaining calculated fields)

I'm currently using a date field in one of my tables to populate this first field (the full SQL is in a separate thread here)

But that was just a convenient way of getting a list of dates; the dates in that table don't actually have any significance to the resulting dataset (other than they should roughly overlap with the dates I'm looking for)

The flaw in that method is that the table from which I get those dates can only ever have dates up to and including yesterday. I also need to get today's date in there (and calculate the subqueries based on that date as well).

It's also possible - although unlikely - that there could be random dates missing from that table as well - in which case I need to plug those gaps and calculate my fields for those missing dates as well.

For clarity; that first field (AsOfDate) should contain every weekday from the earliest date in that table (i.e. Min([tblBalances].[BalanceDate]) up to and including today. It doesn't matter if any of the dates inbetween are missing from tblBalances as the subqueries will just return zeroes for those dates (which is exactly what I want to see).

View 3 Replies View Related

Date Select Query

Feb 28, 2006

I have set up a query that includes:

An assignment start date
An assignment end date

and in addition a column has been set up to show me a Start Date where Assignment End Dates are Null i.e all live assignments.

When I enter a date only results for that particular date are visible.

Can anyone suggest how i can expand this to include all live assignments?

Thanks

View 1 Replies View Related

Query To Select Max Date

Jan 17, 2006

I have attached a small sample DB.

What I'm trying to do is to find the most recent payment date for each customer before 01/13/2006.

These are the results I'm looking for.
Customer 123456 should return the date 12/01/2005
Customer 12345 should returtn the date 01/01/2006

Can someone show me how to write a query to accomplish this?

Thanks

View 1 Replies View Related

Forms :: How To Create A Form That Cancel Appointment Through Query

Mar 8, 2015

how i could create a form that cancels an appointment i guess through a query..

View 4 Replies View Related

Problem With Select Query Using Date Parameters

Jan 7, 2008

Below is an example of my table "Current Status"

Manufacturer ID___SN________Current Location__Status Date______Time
A________________1____________Area 1________1/6/2008_______3:15
A________________1____________Area 2________1/7/2008_______2:10 PM
A________________1____________Area 3________1/8/2008_______1:01 PM
B________________2____________Area 3________1/2/2008_______5:00 PM
B________________2____________Area 2________1/3/2008_______3:00 PM
B________________2____________Area 4________1/4/2008_______12:47 PM

How can I design a query that will return each products latest currrent location by date, aka, the third and sixth record???? Thank you, I am relativley new to access and am struggling with this.

View 5 Replies View Related

Can't Select Date Range In Corsstab Query

Apr 23, 2008

Hi folks,
I have a crosstab query that counts the number of records that each employee has.

I need to be able to specify the date range to show though and the query won't let me use:
"Between [Type the beginning date:] And [Type the ending date:]"

I've attached a snapshot of my query design and output.
I've tried everything I could think of!!

View 2 Replies View Related

Cannot Get Query To Work With My Date Select Form

Jan 5, 2006

With the imense help of some of the people in this forum, I have scraped together a nice little database.
There is one function, however, which is not working.

I have a query that should run from a form I have created. The form has multiple criteria and all seem to be working except for the date fields... "First Order" and "Last Order".
The way I have it set up is that I have a table of dates. The form has a list box of the dates (first of the month, for 4 years).
The source data in the form reads: SELECT [TDateSelect].[StartDates] FROM TDateSelect ORDER BY [TDateSelect].[StartDates]; (for each of the 2 "minimum" dates)
and SELECT [TDateSelect].[EndDates] FROM TDateSelect ORDER BY [TDateSelect].[EndDates]; (for each of the 2 "max" dates)
The user is allowed to select a date range for the first order and the last order. (4 dates altogether).

The form looks fine.

In the query, I have set the criteria for the last date as:
Between [Forms]![FSetOtherCriteria].[MinLast] And [Forms]![FSetOtherCriteria].[MaxLast]

When I run the query (even with a wide date range) I get no results. When I remove the dates from the query, or enter the limits manually, the query works like a dream.

Any ideas???

View 3 Replies View Related

Select Query For Latest Previous Date

Oct 2, 2006

My table shows
ID ID_Clients EndDate

A particular value of ID_Clients can recur many times, but with different EndDate value each time.

I want to create a select query that displays
ID_Clients EndDate LatestPreviousEndDate

Any help with this would be much appreciated.

-Thanks

View 1 Replies View Related

Queries :: Date / Time Query - Return All Records Of Specified Date Or Date Range

Aug 19, 2015

I have a table that has entries recorded with date and time in one field, and I want to have a query that returns all records of a specified date or date range, regardless of the time in the field.

I have tried

Code:
Between [StartDate:] And [EndDate:]

And

Code:
Between [StartDate:] & "00:00" And [EndDate:] & "23:59"

Neither of which work ....

View 13 Replies View Related

Select Query To Find Empty Date Fields

Jan 26, 2008

I am trying to create a select query on "ApprovedDate" where no approval is recorded. IsNull returns an expected type mismatch. Any ideas?
Regards:confused:

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved