Return Earliest Date

Sep 8, 2005

Ok, I have a query that returns a case manager, their clients, and a date attributed to each client. Ex:

Case Manager Client Order Date
James Bond Pussy Galore 01/05/2005
Oliver Cromwell Janet Roundhead 05/25/2005
Alan Turing E. Nigma 08/20/2005
James Bond Holly Goodhead 12/18/2004


What I would like is for the first James Bond record to disappear, as it is later than the last record, giving me only the FIRST Order Date for each Case Manager. Is this possible? If so, what is the criterion expression?

View Replies


ADVERTISEMENT

Asking For The Earliest Date In A Query

Sep 20, 2004

I have a table that contains ID numbers plus appointments that these patients have had with a carer. The appointments are a dd/mm/yyyy entry and there are a number associated with every patient.

I need to isolate the first/earliest date the patient was seen. What is the criteria I use in a query??

View 1 Replies View Related

Default Earliest Date And Latest

Dec 14, 2012

I would like for my report for default to the earliest and latest date ,should the user not select a start date and end date.

I have read about using MIN and MAX , but i am not sure how this would work.

View 3 Replies View Related

Queries :: Expressions - Earliest Date Of When Documents Received

Jun 12, 2014

I have the below listed expression, which will give me the earliest date of when documents were received.

However, if I only have a date in the "B - Datasheets" field, it will not appear on my report because it starts off "isnull".

How can I end the expression to use this date field if there are no other dates?

Submittal: IIf(Not IsNull([BID_PO]![B - Datasheets]) And [BID_PO]![B - Datasheets]<[BID_PO]![C - Curves (Performance Data)] And [BID_PO]![B - Datasheets]<[BID_PO]![D - Schematics] And [BID_PO]![B - Datasheets]<[BID_PO]![E - Drawings],[BID_PO]![B - Datasheets],IIf(Not IsNull([BID_PO]![C - Curves (Performance Data)]) And [BID_PO]![C - Curves (Performance Data)]<[BID_PO]![D - Schematics] And [BID_PO]![C - Curves (Performance Data)]<[BID_PO]![E - Drawings],[BID_PO]![C - Curves (Performance Data)],IIf(Not IsNull([BID_PO]![D - Schematics]) And [BID_PO]![D - Schematics]<[BID_PO]![E - Drawings],[BID_PO]![D - Schematics])))

View 2 Replies View Related

Forms :: Sort Mainform Based On Earliest Date On Subform?

Dec 13, 2013

I have a form which shows training events - these can take place over one or several days, and can be run by one trainer or several, so I have my basic Events Info in one table (EventID, EventType, Location, that kind of thing) and the 'Jobs' in a separate table (EventID, JobDate, TrainerID, etc)

The problem I'm having is that I want the List of Events to be sorted in order of their start date... which is on the subform, not the main form.

How can I go about it - and still leave both the main and subforms fully editable?

View 12 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

Queries :: When Date Null Return Today's Date

Aug 8, 2013

I have a query where I display the [OPEN DATE] and [CLOSE DATE] of my cases. However, when I run this query sometimes the cases are not closed yet, therefore there are null values. However, I also have a field to calculate the datediff between these two dates. I need the [CLOSE DATE] field to display today's date when it is a null value so that I can still get a count of the days using datediff when I run the query.

View 1 Replies View Related

Return Most Recent Date

Jul 22, 2005

Using MS Access XP

Here's the scenario. I have 3 fields [AgentID], [QA Date], [Points Issued]. What I want to do is run a query that will give me the last date [QA Date] a point [Points Issued] was issued for each agent [AgentID]. And I want the query to display all 3 fields according. Is this possible?

View 2 Replies View Related

Return 'month' For A Given Date

Sep 26, 2005

I have a table which has a column 'Date', which contains dates in the format dd/mm/yy. I wish to produce a quiery which will produce an extra column entitled 'month', which will match each date to the month of that date. I know there is a formula which does this (called 'month' i think), but i dont know how to use it to achieve what I want.

Any help would be greatly appreciated!

View 1 Replies View Related

Trying To Return Latest Date

Oct 21, 2005

I've run several searches and can't seem to find what I'm looking for, so here goes:

Have a table with several (maybe as many as 30) dates related to each employee, such as:

NAME-------CLASS 1-----CLASS 2----CLASS 3
J.Johnson.....10/16/05 ......12/17/05...12/25/05
S.Smith.........09/05/05......10/15/05

Not all employees will have entries in every class.

Need a query to result in most recent Date for each employee, such as:
--------------
J.Johnson......CLASS 3........12/25/05
S.Smith.........CLASS 2.......10/15/05

Any suggestions?

View 3 Replies View Related

Checkbox To Return Date Problem

Oct 27, 2004

New to Access...
With the following code, the checkbox works, yet in the form when you check the checkbox...all the other boxes
are checked as well.
1. Checking the box return the date
2. UNchecking the box does not clear the date but it unchecks all of the boxes on the form list.

--------------
Private Sub Check30_AfterUpdate()
If [Check30] = True Then
[DATE_PAID] = Now()
Else
End If
End Sub
--------------
Suggestions?

musiclee61

View 3 Replies View Related

Queries :: Return All Records With Last / Max Date

Apr 10, 2013

My issue surrounds retrieving the last (based on most recent date) set of records based on the most recent date. I have query, containing 2 tables as the sources for the query results. Currently, the query yields:

Field A Field B Field C
123456 AAAA 1/8/13
123456 BBBBI 1/8/13
123456 CCCC 1/8/13
123456 DDDD 1/8/13
123456 EEEEEE 3/10/13
123456 FFFFFF 3/10/13
123456 GGGG 3/10/13
123456 HHHH 3/28/13
123456 IIII 3/28/13
123456 JJJJ 3/28/13

The desired results would be to return all records with the last/max date, so yield:

123456 HHHH 3/28/13
123456 IIII 3/28/13
123456 JJJJ 3/28/13

I have tried the max & last functions, yet no success.

View 1 Replies View Related

Queries :: Extract Day From The Date And Return A Value

Feb 20, 2014

I have a list of dates on which tasks were performed.

I want to be able to see if there is a pattern, i.e. lots done on a Monday

Can I extract the Day from the date, and return a value Monday, Tuesday, Wednesday etc??

View 3 Replies View Related

Date Comparison Return Certain Information

Sep 22, 2014

I have a date field (DueDate) that I am comparing against the current date (Date()). When the current date is greater than the DueDate I filter just those dates. I have done that without any problems. Now I am trying to figure out how to compare that filtered information to show that the DueDate is either over 30 days, over 60 days, or over 90 days overdo. If it shows up on either one of those lists I do NOT want it to show up on the other lists. I also want to have a counter by states. For example:

Current Date DueDate State
a. 9/22/14 2/1/14 GA *(90)
b. 9/22/14 8/20/14 WV *(30)
c. 9/22/14 7/1/14 WV *(60)
d. 9/22/14 8/19/14 GA *(30)
e. 9/22/14 7/31/14 GA *(30)
f. 9/22/14 3/1/14 WV *(90)
g. 9/22/14 7/20/14 SC *(60)

The output I want should be:

over 30 days:
GA 2
WV 1

over 60 days:
SC 1
WV 1

over 90 days:
GA 1
WV 1

View 2 Replies View Related

Query Needed To Return Last, Or Next To Last, Value Based On Date...

Apr 23, 2007

I have the following tables: Rates and SelectedDates, which are structured as follows.

Rates: RateID, EffectiveDate, Rate
SelectedDates: Date. Table is bound to a combobox in which user selects one or more dates, mm/dd/yyyy, which is the same format as Rates.EffectiveDate.

I need a query to return the first Rates.Rate for the following conditions. (there will be a minimum of one record in the Rates table)

IF there is only one Rates.EffectiveDate for the SelectedDates.Date
return the associated Rates.Rate

ELSE IF count(Rates.EffectiveDate <= SelectedDates.Date)>=1
return the first Rates.Rate where Rates.EffectiveDate <= SelectedDates.Date

ELSE
return Rates.Rate associated to the Rates.EffectiveDate closest to the SelectedDates.Date.


I hope this is clear, as it is late and I am tired...:confused:

Thanks in advance,
Rod

View 1 Replies View Related

Queries :: Return Max Date Of Multiple Columns

Jul 28, 2014

How do you return the most recent date of multiple columns.

I have a table (tbl_courses) that has a list of training courses. We want to know when a client completed the course most recently.

The problem is, for one course there has been up to 4/5 different variations of the course with different names over the years. E.g. "Drug awareness" has also been known as "Drug Aware" "Illegal Substances" and "Stoppers". I want to pull through the most recent date for all of the above.

We have a field in the Courses table that links the courses into groups (e.g. All drug aware courses come under "23"). Not sure if that works?

Is there a way to do this? The Tbl_Courses is linked to Tbl_Clients via a ClientID.

I've managed to do it in SQL using GREATEST() but that isn't an option in Access.

View 6 Replies View Related

Queries :: Return Selected Date Plus Next Three Days

Mar 22, 2015

Ok, so I'm sure this is a pretty simple criteria, but I just can't seem to get the syntax right.

I'm trying to allow my user to select any start date and the query will return that date plus the next three days.

View 7 Replies View Related

General :: Return Date Of Previous Day Of Week

Apr 8, 2014

I would like a field's default value to return the date of the previous Monday.

For example:
Now = Tuesday, 08-Apr-14
Return Monday, 07-Apr-14

Further example:
Now = Saturday, 12-Apr-14
Return Monday, 07-Apr-14

View 6 Replies View Related

Queries :: How To Lookup Date And Return Value From Another Table

Jul 30, 2015

Basically, i have a table ("Transaction") with payment date and another table ("Control") with accounting dates and corresponding year/month.

Objective: I need to know which accounting year or month these payment date fall under.

Example: If the payment date is 18 Dec 2013, the accounting year should read as 2013 and the accounting month should read as 12.

In excel, this is very simple using vlookup.

I tried for hours using access dlookup query and i'm still stucked ..

View 4 Replies View Related

Queries :: Return Entire Rows With Min Date Only

Apr 15, 2015

I am looking to return one row from groups of the same EpisodeID whereby the row with the minimum date is selected each time. This includes returning all other fields in the row such as EventID below and ideally others as well if that will be possible.

To illustrate I include the following. What Access 2003 query would I need to return all the rows with the earliest dates? EventID will be unique in the intial table.

Code:
EventsTable
```````````
EpisodeID | EventID | EventDate
-------------+---------------+-------------
1 | 001 | 01/02/2010
1 | 023 | 05/10/2009
1 | 103 | 12/02/2010
2 | 004 | 02/03/2013
2 | 102 | 12/10/2014
3 | 546 | 04/05/2012
3 | 100 | 08/08/2013
3 | 034 | 10/10/2012
3 | 066 | 02/03/2013
4 | 777 | 05/07/2014
4 | 233 | 01/11/2012
5 | 087 | 10/03/2011

Code:
ExpectedOutput
``````````````
EpisodeID | EventID | EventDate
-------------+-------------------+---------------
1 | 023 | 05/10/2009
2 | 004 | 02/03/2013
3 | 546 | 04/05/2012
4 | 233 | 01/11/2012
5 | 087 | 10/03/2011

View 13 Replies View Related

Modules & VBA :: Option Group - IIF Date Return

May 2, 2014

I have a date field in a form fed by an option group. Most of the options return the correct values, but I'm having a hard time with this:

If the inspection date (in another form) is in Jan Feb or March, then return the date 1 Apr of the inspection year. If not, then return 1 Apr of the following year.

Here is the trouble line:

Code:
Case 2
IIf (Month([Forms]![FrmGeneralInspection]![txtInspectionDate]) <= 3), Me![txtReInspectionDate] = DateSerial(Year([Forms]![FrmGeneralInspection]![txtInspectionDate]) + 1, 4, 1), Me![txtReInspectionDate] = DateSerial(Year([Forms]![FrmGeneralInspection]![txtInspectionDate]) + 2, 4, 1)

View 4 Replies View Related

Queries :: Return Week Number On The Basis Of Date

Jan 23, 2014

I've been trying to create a query that will take a date and return the week number of the date.

My original date is formatted m/d/yyyy

I need my weeks to start on Monday and I would like the week containing Jan 1st to be the first week of the year

I have tried using the following function:

DatePart("ww",#12/31/2001#,2,1)

but the I get a result of 53 in this query, when I expected/need it to be 1.

View 4 Replies View Related

Queries :: Return Date Of Next Monday - Routine Not Working

May 13, 2014

Today is 13 May and this code is supposed to return the date of next Monday (19 May)

IIf(Weekday(Date())=1,Date()+1,Date()-(Weekday(Date())+9))

but it returns 1/5/2014 (Thursday May 1), when "Date" = 13/5/2014 (Tuesday May 13)

My begin week is Sunday (1) ,

View 8 Replies View Related

Forms :: Return Records From One Table Based On Date In Another

Jul 24, 2013

When I add a record to table A (using a form) the first field I enter is a date. That date will then determine which records I see in my drop down list from table B (via a query).

Some records in table B have EffectiveFrom and EffectiveTo dates recorded - because they are now obsolete, other records have no dates recorded in these fields because they active.

How can I view and then select from the drop down only those records in table B which are effective/valid to the date entered in table A?

View 1 Replies View Related

Queries :: Convert EST To BST - Using SWITCH To Return A Date / Time

Nov 14, 2014

Trying to import some data from a linked Excel spreadsheet into a local table. One of the fields is a Date/Time type and is recorded in EST (Eastern Standard Time). I want to keep this field for posterity but also add a separate field with the corresponding time as per BST

For clarity, daylight savings time comes into effect this year on 26th Oct in the UK and 2nd Nov in the US. So generally, there is a 5 hour difference between the two time zones, apart from the period between these two dates, when it is only 4 hours.Here is my query - I am using a SWITCH function to create the BST field

Code:
INSERT INTO tblTransactions
SELECT ltbPayments.ID AS Reference, ltbPayments.VALUEDATE AS ValueDate, ltbPayments.LOCALAMOUNT AS Amount, ltbPayments.USDAMOUNT AS AmountUSD, tblAccounts.AccountID AS AccountID, ltbPayments.TRANSACTIONTIME AS TransactionTimeEST,
SWITCH(DateValue(ltbPayments.TRANSACTIONTIME) < DateSerial(2014,10,26) Or DateValue(ltbPayments.TRANSACTIONTIME) >= DateSerial(2014,11,2),

[code]....

So - how do I explicitly specify the output of the SWITCH function to be in Date/Time format (I presume, by default, it's returning Text, which contradicts the table properties of tblTransactions & the TransactionTimeBST field?...)

View 1 Replies View Related

Form And Query To Return Records Between Certain Date Range

Oct 15, 2013

First, I am trying to get a query to return records between a certain date range. In the form I have DateFrom and DateTo unbound text boxes from which faculty select the date range. I know I have done this before, but I cant figure out how to create a field name and write the criteria for the source query in design mode!

I tried [Form]![FormName]![DateFrom]<[Form]![FormName]![DateTo] in the criteria but I can't seem to write a valid field name that doesn't alter the criteria in some way...

Second, in the same form, faculty enter the StudentID for the student they wish to get records for. How do I write the code to show a msgbox when there is no such ID in the event they enter an StudentID incorrectly.

View 1 Replies View Related







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