Solved

DMin refresher

Posted on 2013-01-31
6
283 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
  • 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 200 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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 300 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now