Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get acces to evaluate what day it is and update text

Status
Not open for further replies.

levelhot

IS-IT--Management
Dec 29, 2003
5
US
I'm using IIF function to evaluate weekday function and update text based on that, but no matter what Access always returns true part here's the code. Does anyone have some insight or solutions to make this expression works.

Here's the code:

IIf(Weekday(Now()=2),&quot;<QUERY>(ListStatus=|with,exp,temp),(StatusChangeDate=&quot; & Format(DateAdd(&quot;d&quot;,-3,Now()),&quot;mm/dd/yyyy hh:nn&quot;) & &quot;+)</QUERY>&quot;,&quot;<QUERY>(ListStatus=|with,exp,temp),(StatusChangeDate=&quot; & Format(DateAdd(&quot;d&quot;,-1,Now()),&quot;mm/dd/yyyy hh:nn&quot;) & &quot;+)</QUERY>&quot;)

Any suggestions

Thanks

Level Hot

PS TEK-TiPs RuLeZ
 
I think you have the second closing bracket in the wrong place. Try changing it as follows:

IIf(Weekday(Now()[blue])[/blue]=2[red])[/red],&quot;<QUERY>(ListStatus=|with,exp,temp),(StatusChangeDate=&quot; & Format(DateAdd(&quot;d&quot;,-3,Now()),&quot;mm/dd/yyyy hh:nn&quot;) & &quot;+)</QUERY>&quot;,&quot;<QUERY>(ListStatus=|with,exp,temp),(StatusChangeDate=&quot; & Format(DateAdd(&quot;d&quot;,-1,Now()),&quot;mm/dd/yyyy hh:nn&quot;) & &quot;+)</QUERY>&quot;)

Remove the red bracket, replace it with the blue bracket.

Hope that sorts it out,


Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)
 
The expression should always evaluate as true since:
(Now()=2) equals 0
Weekday(0) equals 7
7 is not 0 so it will return true.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Steve101 u r correct. It was just the bracket placement. I was going crazy wondering why the experssion was not working. Tek-TiPs is batting 1000 and i will continue to utilize your expertise and knowledge. Thanks once again and I wish you guyz a happy new year!

Thanks,

Level Hot

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top