Dlookup

newbie786

New member
Local time
Today, 17:56
Joined
Jul 7, 2015
Messages
8
Hi I cant seem to get my head round this, im trying to lookup 2 fields in a xls file with 2 criteria's in my dlookup,

this is what my code looks like for lookup of 1 field;

=Dlookup("morning","JulyLinked',"day=" & day(date()))

this works for looking up the day field in the linked table julylinked and matching this up with the day in that day.


but what im trying to do is match up the day as well as the month so my code looks something like this:

=Dlookup("morning","JulyLinked',"day=" & day(date())and "month=" & month(date()))

but doesnt work

any ideas?
 
Does JulyLinked have a field called Month
B.T.Y. Day and Month are reserved words and should not be used as field names.
 
Hi Bob_fitz

The fields in JulyLinked are Day and month, I have tried to change them but still not working
 
You've the " in the wrong place and you're missing a &, change it to the below:
Code:
=Dlookup("morning","JulyLinked',"day=" & day(date()) [B][COLOR=Red]& "[/COLOR][/B] and month=" & month(date()))
Looking at your table name JulyLinked make me suspicious that you have a table for each month and that is incorrect in database context.
 

Users who are viewing this thread

Back
Top Bottom