T
Ted Allen
Hi,
I couldn't follow exactly which date you want to use in
your iif criteria, but you need to compare some date's
datepart to check the day of the week. Currently your iif
() function is evaluating your expression to see if it is
true, but all you have listed is weekday(2), which will
never equal true.
Instead, try:
iif(DatePart("w",[YourDateField])=2,TruePart, FalsePart)
In addition, I don't know that you can put the >= sign
inside your iif statement. Try putting the > sign, or >=
sign in front of the iif condition, and adjust the true
part and false part to go with whichever one you use.
Hope this helps. Post back if it doesn't work or if you
have any questions.
-Ted Allen
is a Monday, it needs to pick up Friday, Saturday and
Sunday. I have looked at some vba around similar things
but don't understand where or how to use it so if I can
do it in the query all the better.
is flawed. Variations return everything 3 days ago
irrespective of what day it is, so it makes me question
whether the if statement is working at all.
yesterday if not monday or Fri/Sat/Sun if monday and in
either case where date 2-date 1>7.
I couldn't follow exactly which date you want to use in
your iif criteria, but you need to compare some date's
datepart to check the day of the week. Currently your iif
() function is evaluating your expression to see if it is
true, but all you have listed is weekday(2), which will
never equal true.
Instead, try:
iif(DatePart("w",[YourDateField])=2,TruePart, FalsePart)
In addition, I don't know that you can put the >= sign
inside your iif statement. Try putting the > sign, or >=
sign in front of the iif condition, and adjust the true
part and false part to go with whichever one you use.
Hope this helps. Post back if it doesn't work or if you
have any questions.
-Ted Allen
display records where [date 2]-[date 1]>7, which is fine.-----Original Message-----
Hiya, I hope someone here can help me with this.
I have 2 date fields in a query. I would like to only
today is Wednesday it will pick up Tuesday. When the dateHowever, this is dependent upon yesterday's date. So, if
is a Monday, it needs to pick up Friday, Saturday and
Sunday. I have looked at some vba around similar things
but don't understand where or how to use it so if I can
do it in the query all the better.
does not return anything. I don't know if placement of >=I tried Iif(weekday(2), >=date()-3,date()-1) but this
is flawed. Variations return everything 3 days ago
irrespective of what day it is, so it makes me question
whether the if statement is working at all.
the current day of week, then selects the data for eitherMy goal is to have a query that automatically looks at
yesterday if not monday or Fri/Sat/Sun if monday and in
either case where date 2-date 1>7.