?
Solved

DMin refresher

Posted on 2013-01-31
6
Medium Priority
?
290 Views
Last Modified: 2013-01-31
I am trying to look up the oldest order a member made to update the member table but need a refresher.

Here's what I have:
t: DMin("DeliveryDate","tblTranslationContractHistory","[tblTranslationContractHistory]![ContactID] = [tblTranslationContractMembers]![ContactID] ")

The sql error is can't find the name tblTranslationContractMembers.ContactID

Any ideas to fix my a lib syntax?
0
Comment
Question by:Shawn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 26

Expert Comment

by:jerryb30
ID: 38841575
Can you give the full context of the query?
0
 
LVL 26

Assisted Solution

by:jerryb30
jerryb30 earned 800 total points
ID: 38841592
winging it:

select [contactID],  DMin("DeliveryDate","tblTranslationContractHistory","[tblTranslationContractHistory]![ContactID] = ' " & a.[contactID] & "'") as t from [tblTranslationContractMembers] as a
0
 
LVL 1

Author Comment

by:Shawn
ID: 38841914
note quite.

Here is a query which works but it is a groupby query qhich doesn't work to update. I need the equivalent with dmin.

SELECT tblTranslationContractMembers.DateStart, tblTranslationContractMembers.ContactID, Min(tblTranslationContractHistory.DeliveryDate) AS MinOfDeliveryDate
FROM tblTranslationContractHistory INNER JOIN tblTranslationContractMembers ON tblTranslationContractHistory.ContactID = tblTranslationContractMembers.ContactID
GROUP BY tblTranslationContractMembers.DateStart, tblTranslationContractMembers.ContactID;
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 26

Expert Comment

by:jerryb30
ID: 38841922
Just to save me some time, can you post a sample db with some dummy data?
And, maybe what you are trying to update.
0
 
LVL 11

Accepted Solution

by:
datAdrenaline earned 1200 total points
ID: 38842401
Give this a whirl ...

SELECT tblTranslationContractMembers.DateStart
      , tblTranslationContractMembers.ContactID
      , vtblFirstDeliveries.FirstDelivery
FROM tblTranslationContractMembers
     LEFT JOIN
       (SELECT ContactId, Min(DeliveryDate) As FirstDelivery
        FROM tblTranslationContractHistory
        GROUP BY ContactId) As vtblFirstDeliveries 
     ON tblTranslationContractMembers.ContactId = vtblFirstDeliveries.ContactId

Open in new window

0
 
LVL 1

Author Comment

by:Shawn
ID: 38842528
wow  datAdrenaline, you knocked it out of the park. Nice.

I also got this to work but I like your query.

DMin("DeliveryDate";"tblTranslationContractHistory";"ContactID=" & [contactID])
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question