Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / May 2008

Tip: Looking for answers? Try searching our database.

Show last date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
instereo911 - 19 May 2008 18:42 GMT
Hello,

I have a query that has a date/time field on it and in the criteria field i
have Date()-1.

My problem is that on Sunday there is no data... so what I want to do is
something like  

Date(show max date only).

SQL Version:
HAVING (((TotalClaimsInventory.Date)=Date()-1))

I am sure this easy but I don't know how to do it.

Thank you everyone again for your help.
Jeff Boyce - 19 May 2008 18:57 GMT
In a query (design view) you can click on the Totals toolbar button (the
"sigma") to get at the "Maximum" aggregation.  This should give you a way to
find the "last" (i.e., most recent, i.e., Maximum) date in a date/time
field.

By the way, if your field is named "Date", and you tell Access to use
"Date", do you want it to use YOUR [Date] field or its own built in function
Date()?  Confused?  No?  Access is!  Change the name of your field to
something more meaningful ... "Date" is a reserved word in Access.

Regards

Jeff Boyce
Microsoft Office/Access MVP

> Hello,
>
[quoted text clipped - 13 lines]
>
> Thank you everyone again for your help.
John Spencer - 19 May 2008 20:13 GMT
Perhaps what you want is

Field: YourDateField
Criteria: DMAX("YourDateField","YourTableName")

That will find all records with the latest date

If you are trying to get all the records for the latest date before today,
change the criteria to
Criteria: DMAX("YourDateField","YourTableName","YourDateField<Date()")

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County

> In a query (design view) you can click on the Totals toolbar button (the
> "sigma") to get at the "Maximum" aggregation.  This should give you a way to
[quoted text clipped - 28 lines]
>>
>> Thank you everyone again for your help.
instereo911 - 19 May 2008 21:00 GMT
Thank you both... I changed the date name and used the DMAX.. worked perfect.

I appriciate it tons

>Perhaps what you want is
>
[quoted text clipped - 17 lines]
>>>
>>> Thank you everyone again for your help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.