topjobs Posted March 31, 2009 Posted March 31, 2009 I would like to have a field that shows 1 if the date field is at or prior to 1/1/09 and 0 if the date is after 1/1/09. Thank you
Josh Ormond Posted March 31, 2009 Posted March 31, 2009 Case (Date < "1/1/2009"; 1; Date > "1/1/2009"; 0) Assuming you don't want 1/1/2009 included. If you want 1/1/2009 to calculate as 0: Case (Date < "1/1/2009"; 1; Date ≥ "1/1/2009"; 0) If you want 1/1/2009 to calculate as 1: Case (Date ≤ "1/1/2009"; 1; Date > "1/1/2009"; 0)
mr_vodka Posted March 31, 2009 Posted March 31, 2009 Case (Date < "1/1/2009"; 1; Date > "1/1/2009"; 0) Assuming you don't want 1/1/2009 included. If you want 1/1/2009 to calculate as 0: Case (Date < "1/1/2009"; 1; Date ≥ "1/1/2009"; 0) If you want 1/1/2009 to calculate as 1: Case (Date ≤ "1/1/2009"; 1; Date > "1/1/2009"; 0) This wont work.
Josh Ormond Posted March 31, 2009 Posted March 31, 2009 Thanks John. I always use the GetAsDate() function, but always forget to include it in my replies.
comment Posted March 31, 2009 Posted March 31, 2009 I NEVER use the GetAsDate() function to specify a date, because it relies on the local date format: YourDate ≤ Date ( 1 ; 1 ; 2009 )
Josh Ormond Posted March 31, 2009 Posted March 31, 2009 Still working that one into my memory banks. That's the problem with self-taught strategies. Bad habits. Thanks comment.
Lee Smith Posted March 31, 2009 Posted March 31, 2009 What do you want to happen on January 1, 2010 with this flag?
comment Posted March 31, 2009 Posted March 31, 2009 That's a good question, one that I forgot to ask.
Recommended Posts
This topic is 5775 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now