A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access equivalent to Excel's VLookup function



 
 
Thread Tools Display Modes
  #11  
Old March 13th, 2006, 07:11 AM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default Access equivalent to Excel's VLookup function

Tom & John,

Thanks very much for your help on this matter.

Tom, I am taking your advice on learning SQL. I tried your SQL construct
and it works! I simplified the problem, however. Both tables are linked to
another table. For example, the price table is actually Price TableA with
fields of ItemID, Attribute #1, Attibrute #2, etc. and links with Price
TableB with fields of ItemID (the link), Date of Price Change, and Price.
That is, looking at the Price TableA with Price TableB as a subtable shows
the price history for each item. How does this affect the SQL statement you
sent me? Hope it doesn't complicate it too much.

John, I will try your lookup expression and compare the results.

Again, thanks to both of you for your help.

John

"John Vinson" wrote:

On Sat, 11 Mar 2006 20:54:24 -0800, john431
wrote:

Thank you for your reply, John.

I tried the DMax criteria for the Price field, which is the value I am
looking for. I used =DMax("[Price]", "[Price Table]", "[ItemID]="&[ItemID]).
This gave me the maximum value of the price for all cases of the Purchase
Date. For example, if the price table for a product is:


To get the most recent price using domain functions, try

=DLookUp("[Price]", "[Price Table]", "[ItemID] = " & [ItemID] & " AND
[Date Of Price Change] = #" & DMax("[Date Of Price Change]", "[Price
Table]", "[ItemID] = " & [ItemID]))

Or... much more efficient - use a Query. Just because VLookUp is the
typical solution in Excel doesn't mean that there is a "VLookUp
Equivalent" in Access. Excel is a spreadsheet; Access is a relational
database! They have different structures, different techniques, and
require different thinking.

John W. Vinson[MVP]

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access versions and SQL Leony General Discussion 12 February 13th, 2006 08:20 PM
Ambiguous Name Error pm Using Forms 10 June 5th, 2005 09:19 PM
Hiding Access Mark A. Sam Using Forms 4 December 1st, 2004 09:09 PM
Access 2000 -vs- Access 2003? Mark General Discussion 5 November 30th, 2004 06:36 AM
transpose john Using Forms 1 November 24th, 2004 06:16 PM


All times are GMT +1. The time now is 02:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.