?
Solved

DMin refresher

Posted on 2013-01-31
6
Medium Priority
?
292 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

649 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