Amanda Posted January 24, 2008 Share Posted January 24, 2008 Hi- this seems like it would be a simple question and I can't figure out why it is giving me so much grief. smiley-cry I am creating a calculation to see if an event date is within a specific range (example: if it is within 3 months of the date, or 1 months of the date, then this is the result) I have been trying to use the "..." for range but it keeps saying "This number can not be evaluated" What am I doing wrong? Thank you in advance. Link to comment Share on other sites More sharing options...
Ender Posted January 24, 2008 Share Posted January 24, 2008 For checking if a value is within a date range, use AND to join the two conditions: if(value ≥ dateStart and value ≤ endDate; result1; result2) Link to comment Share on other sites More sharing options...
AHunter3 Posted January 24, 2008 Share Posted January 24, 2008 The "..." range is used in Find operations, not in calc functions. (I never before thought about that being a discrepancy). Instead of Myfield = 3/1/1975...11/6/1979 you want a syntax akin to Myfield ≥ GetasDate ("3/1/1975") and Myfield ≤ GetasDate ("11/6/1979") Link to comment Share on other sites More sharing options...
Amanda Posted January 24, 2008 Author Share Posted January 24, 2008 Hi- Thank you for your help. Here is what I put in the calculation but I don't think it is coming up with the right results. It should result in yes if the EventDate is less than 3 months but more than 1 month before the EventDate. Right now it only results in NO. If ( EventDate ≥ (EventDate - 90) and EventDate ≤ (EventDate - 30); "yes"; "no" ) Thank you, Amanda smiley-laughing Link to comment Share on other sites More sharing options...
mfif Posted January 24, 2008 Share Posted January 24, 2008 You're using the same name for the two EventDates you're comparing. Are they from different tables? Use table notation (Tablename::EventDate). Link to comment Share on other sites More sharing options...
Amanda Posted January 24, 2008 Author Share Posted January 24, 2008 Hi- I'm actually not comparing two different dates but trying to find out if the one date is within a specific range. The EventDate is just one field. Thanks, Amanda Link to comment Share on other sites More sharing options...
AHunter3 Posted January 24, 2008 Share Posted January 24, 2008 Under what circumstances would ANY date field EVER fail to be greater than or equal to itself minus 90? Under what circumstances would ANY date field EVER be less than or equal to itself minus 30? :confused: That's like saying If 6 is greater than 6 minus 3, do this; if 6 is less than 6 minus 2, do that. Link to comment Share on other sites More sharing options...
Amanda Posted January 24, 2008 Author Share Posted January 24, 2008 Ok, I think I've just been starring at my computer too long. Opps! Yes, that doesn't make any sense and of course I would need two different dates (one being the current date) duh! Thanks for your help. Amanda Link to comment Share on other sites More sharing options...
Recommended Posts