Lister
Z Shift
- Local time
- Tomorrow, 00:06
- Joined
- Aug 24, 2003
- Messages
- 305
Here at work they now run on a different month they everyone else in the world.
And it causes me no end of headaches trying to write new criteria for it.
Our months start on the 27th of any month and finish on the 26th of the following month.
Now we come to the IIF/TRUE/FALSE thing, which is sending me up the wall.
I want to test a Date to see if it is true. Date Field is [DateOut], this hold the date when a job was sent to a customer.
I don’t want to see any records that were sent out before the current month.
Day greater than 27 = (>27) But less Than 1 (>27 And < 1) Would need to be tested against, DateSerial(Year(Date()),Month(Date()),26)
[DateOut]> DateSerial(Year(Date()),Month(Date()),26)
But what today’s Date is <1 But >26
[DateOut] > DateSerial(Year(Date()),Month(Date())-1,26)
Then what if todays Date is <1 But > 26 and its January?
[DateOut] > DateSerial(Year(Date())-1,Month(Date())-1,26)
Then what if todays Date is >=27 But <1 and its December?
[DateOut] > DateSerial(Year(Date()),12,26)
I hope you get the idea.
I have been having a crack at this all day. And I think I'm on the verge of a stroke.
In a unbound field in a query I would like to use this [DateOut] > Iif (Day(Date())>27 And Month (Date())=12,…. Etc
Then Set the Criteria to <>False.
But I am getting stumped with all the IIF Statements.
Now am I on the right track?
Any ideas or help links would be great. I know that some of you our there are very adept at IIf statment within a query.
Think I need to step back, just to many trees and not enough forest at the moment I think.
And it causes me no end of headaches trying to write new criteria for it.
Our months start on the 27th of any month and finish on the 26th of the following month.
Now we come to the IIF/TRUE/FALSE thing, which is sending me up the wall.
I want to test a Date to see if it is true. Date Field is [DateOut], this hold the date when a job was sent to a customer.
I don’t want to see any records that were sent out before the current month.
Day greater than 27 = (>27) But less Than 1 (>27 And < 1) Would need to be tested against, DateSerial(Year(Date()),Month(Date()),26)
[DateOut]> DateSerial(Year(Date()),Month(Date()),26)
But what today’s Date is <1 But >26
[DateOut] > DateSerial(Year(Date()),Month(Date())-1,26)
Then what if todays Date is <1 But > 26 and its January?
[DateOut] > DateSerial(Year(Date())-1,Month(Date())-1,26)
Then what if todays Date is >=27 But <1 and its December?
[DateOut] > DateSerial(Year(Date()),12,26)
I hope you get the idea.
I have been having a crack at this all day. And I think I'm on the verge of a stroke.
In a unbound field in a query I would like to use this [DateOut] > Iif (Day(Date())>27 And Month (Date())=12,…. Etc
Then Set the Criteria to <>False.
But I am getting stumped with all the IIF Statements.
Now am I on the right track?
Any ideas or help links would be great. I know that some of you our there are very adept at IIf statment within a query.
Think I need to step back, just to many trees and not enough forest at the moment I think.