Link to home
Start Free TrialLog in
Avatar of developingprogrammer

asked on

how to use the excel AND function in access

hey guys, guess this is a real simple / silly question, but how do i use the AND function in access? or the equivalent of it?

what i'm trying to do is find the SRs between 24 and 48 hours. as you can see from the below, i've only got <48 but not <48 and > 24 --> cause i'm not sure which function to substitute AND! haha = )

the alternative is of course using an iif function. but i think that is quite inelegant. could yall help me? thanks guys!! = ))

TAT: Switch(Int([1st Planned Start]-[Created])<1,"<24 hrs",Int([1st Planned Start]-[Created])<2,"<48 hrs",Int([1st Planned Start]-[Created])>=2,">=48 hrs")
Avatar of peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of developingprogrammer


Hey Peter, you were right the first time round. I realised I thought it was wrong because I thought I was already aggregating the function in that formula. But all I'm doing is writing out a text. So if it takes 1.5 days to turn around, int() will turn it into 1 day, and 1 day is = to 1 day, not less than one day. So it will NOT fall into the <24 hrs bucket. The next rule that will be tested is the <48 hrs. And it will be included in that bucket. <br /><br />Thanks for your help Peter, always so reassuring that an expert has affirmed what I was thinking = ))<br /><br />Oh and one more point for anyone that reads this thread, switch function works like case - it evaluates from left to right. Once a criteria is met, it stops there. So align the criteria you want met first on the left then so on and so forth. Peter, do correct me if I'm wrong, but this is what I tested out so far = ) EDIT- oh yes, it's correct, the help file says so haha = ))