Performing a Double Lookup in Microsoft Access Requiring Multiple Criteria

Performing a Double Lookup in Microsoft Access Requiring Multiple Criteria

Computer Learning Zone

1 год назад

8,517 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

NICHOLAS TOLHURST
NICHOLAS TOLHURST - 27.04.2023 15:48

I cant get this to work where the first criteria is a date and the second is an ID field. What should the syntax be for that senario ?

Ответить
Aavalos
Aavalos - 31.03.2023 18:24

Brilliant. Working on a project to have access do a monstrous amount of calculations that we do in Excel. The reason was, no one knew how to do the lookup from one table to the other because the parent table didn't have a value for all in the child, so Access was culling down the child table to just values that are in both tables. So now we can do the calculations in Access and just export the values to Excel.

Ответить
Shahram Ahmadzadeh
Shahram Ahmadzadeh - 11.12.2022 08:19

Thank You

Ответить
Lucky Salomi
Lucky Salomi - 10.12.2022 18:35

Domain functions (Dlookup, dcount, dmax, dsum, etc) are actually offshoots of SQL queries. So, the way I write my Dlookup is this:
=DLOOKUP("CreditLimit", "Customer", "State= ' " & State & " ' " & " AND City= ' " & City & " ' ")

If this is unpacked it results in something like: SELECT CreditLimit FROM Customer WHERE State ='Buffalo' AND State = 'NY'. Classic SQL.
Once you mimick SQL, writing the multiple criteria should be a breeze. Single quote is more readable for the domain functions. Thanks Richard for your valuable contents always.

Ответить
Learn
Learn - 10.12.2022 18:26

Can you show it by query plz

Ответить
Math Magics
Math Magics - 10.12.2022 18:05

Nice video, but as u said i done this work in quarry and its slow vvvv slow

Ответить
db data
db data - 10.12.2022 17:52

10/10

Ответить
Ryan W
Ryan W - 10.12.2022 17:17

I like to use single quotes because multiple double quotes (or triple plus when concatenating) turn me cross eyed. DLookup("CreditLimit", "CustomerT", "City = '" & [City] & "' AND State = '" & [State] & "'")

Or DLookup("CreditLimit", "CustomerT", "City = 'Buffalo' AND State = 'NY' ")

Or to avoid that all together I made a function that returns a string wrapped in single quotes:

Dlookup("CreditLimit", "CustomerT", "City = " & qt(City) & " AND State = " & qt(state))

Ответить