By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,067 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,067 IT Pros & Developers. It's quick & easy.

Multiple criteria access query

P: 1
Hi
I want to make an expression to find out the value of a field particular employee of previous month, and i have put the following expression for it
prevdays:
Expand|Select|Wrap|Line Numbers
  1. DLookUp("[Plus_days_cf]","[ATTENDANCE]","[Emp_code]='" & [ATTENDANCE]![Emp_code] & "'" And "[Month_id]=" & (([ATTENDANCE]![Month_id])-1))
the criteria i have put give work individually but when i combine them it does not work properly. Please help.
Thanks in advance.
Nov 4 '11 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 1,221
Pramod,
I'm sorry, but "it does not work properly." tells next to nothing about the problem you are encountering. What do you mean by that? What is the specific problem with the result you are getting?

What do you mean by "the criteria i have put give work individually but when i combine them" ... do you mean if you use only Emp_code in the criteria it works,and only "Month_id" in the criteria work okay but using both do not work?

Jim
Nov 4 '11 #2

P: 5
hi
I mean to say that when i use the month criteria it show the value for that month but for all employees even(although that not i desire, but half work done), when i use the employee code criteria the value is shown for that employee but in every month. I want to find the value of a particular employee in the last month so i use both the criteria together but then it shows the first value in the table for all the employees in every month. I hope I explained properly.
Please help.
Thanks.
Pramod.
Nov 6 '11 #3

P: 5
i have a table for attendance, in it in a particular month several employees, then in next month and so on. i want a particular fields value to be shown when the criteria matches which if the employee id is same and month id is one less than current, that is previous month.
how to do it, i used the above expression and that returns the value of the first record for all the months and all the employees.
Thanks
Pramod.
Nov 6 '11 #4

NeoPa
Expert Mod 15k+
P: 31,709
This wouldn't have been such a mess if you'd posted the question properly in the first place Pramod. It would have been much clearer to everyone that you just mucked up your strings. Try instead :

Expand|Select|Wrap|Line Numbers
  1. DLookUp("[Plus_days_cf]","[ATTENDANCE]","[Emp_code]='" & [ATTENDANCE]![Emp_code] & "' And [Month_id]=" & [ATTENDANCE]![Month_id]-1)
Nov 11 '11 #5

Post your reply

Sign in to post your reply or Sign up for a free account.