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 2006

Tip: Looking for answers? Try searching our database.

DLast

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinnie - 30 May 2006 12:21 GMT
Hi,

Fairly basic question I'd say, but I'm stuck!

I'm running a DLast function in a query.

In the criteria section, I want the date to be less than or equal to a date
in another table, is it possible to reference another table in the function?

I've tried the following:

DLast("[Comm]","tblRateHistory","[Date]<[tblData]![Date Entered]"), in the
[Comm] field of the query.

[Comm] and [Date] are taken from the tblRateHistory table, and the [Date
Entered] field is taken from the tblData table.

The two tables are included in the query.

Thanks!
Ken Snell (MVP) - 30 May 2006 13:14 GMT
Use the name of the query as the second argument for the function, not the
name of the tblRateHistory table.

Signature

       Ken Snell
<MS ACCESS MVP>

> Hi,
>
[quoted text clipped - 18 lines]
>
> Thanks!
John Spencer - 30 May 2006 13:15 GMT
I suspect that you don't want to use the DLast function.  It returns what
the human can think of as a more or less random value for the specified
field from the matching records.  It is the last record accessed - not the
latest record entered.  You may really want to use DMax or DMin.  However,
try

DLast("[Comm]","tblRateHistory","[Date]<#" & [tblData]![Date Entered] & "#")

If your dates are not in US format of MM/DD/YYYY you may need to format
tblData!DateEntered.

DLast("[Comm]","tblRateHistory","[Date]<" & Format([tblData]![Date
Entered],"\#yyyy\-mm\-dd\# ))

> Hi,
>
[quoted text clipped - 18 lines]
>
> Thanks!
 
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.