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 / September 2005

Tip: Looking for answers? Try searching our database.

Minimum Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CCross - 29 Sep 2005 21:28 GMT
I would like to find the minimum date by comparing the StartDate field in 9
separate department tables. The 9 department tables are linked to a main
table WBS by WBS#.  I would like the WBSStartDate to be the minimum
StartDate.  I am unsure if I can use DLookup or just a nested IIf statement.
Any help greatly appreciated.
CCross
KARL DEWEY - 29 Sep 2005 21:38 GMT
Seems like bad DB structure to have 9 department tables instead of one with a
department field.

For a one time check why not append all into a temp file and check?

> I would like to find the minimum date by comparing the StartDate field in 9
> separate department tables. The 9 department tables are linked to a main
> table WBS by WBS#.  I would like the WBSStartDate to be the minimum
> StartDate.  I am unsure if I can use DLookup or just a nested IIf statement.
> Any help greatly appreciated.
> CCross
John W. Vinson/MVP - 30 Sep 2005 05:56 GMT
>I would like to find the minimum date by comparing the StartDate field in 9
> separate department tables. The 9 department tables are linked to a main
> table WBS by WBS#.  I would like the WBSStartDate to be the minimum
> StartDate.  I am unsure if I can use DLookup or just a nested IIf
> statement.

Karl's exactly right about the table design. One alternative to the append
to a new table is to use a UNION query:

SELECT Min([WBSStartDate]) As Earliest
FROM
(SELECT WBSStartDate, FieldX, FieldY FROM DepartmentA
UNION ALL
SELECT WBSStartDate, FieldX, FieldY FROM DepartmentB
UNION ALL
SELECT... <etc>)

See the online help for UNION.

John W. Vinson/MVP
 
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.