Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm working on an expression, and want to say that if the due date is within then current month, then yes else no.
Would it be this?
if ([Due Date] = Month(Today()), 'Yes', 'No') as [Due This Month]
Or am I nearly right, just not quite there?! Story of my life! lol
Ta
Di
Hi,
If(Month([Due Date])=Month(today()),'Yes','No')
or else
If(Match(month([Due Date])=Month(today()),'Yes','No')
Hi,
If(Month([Due Date])=Month(today()),'Yes','No')
or else
If(Match(month([Due Date])=Month(today()),'Yes','No')
Almost... If you use
if (Month([Due Date]) = Month(Today()), 'Yes', 'No') as [Due This Month]
you will check that the months match. But you will also get a match on November last year with November this year. Then it might be better to use
if (MonthStart([Due Date]) = MonthStart(Today()), 'Yes', 'No') as [Due This Month]
HIC
Diane,
some functions migth be helpful - check help
InMonth (date, basedate , shift)
returns true if date lies inside the month containing basedate. The month can be offset by shift. Shift is an integer, where the value 0 indicates the month which contains basedate. Negative values in shift indicate preceding months and positive values indicate succeeding months.
Examples:
inmonth ( '2006-01-25', '2006-01-01', 0 ) returns true
inmonth ( '2006-01-25', '2006-04-01', 0 ) returns false
inmonth ( '2006-01-25', '2006-01-01', -1 ) returns false
inmonth ( '2005-12-25', '2006-01-01', -1 ) returns true
InMonthToDate (date, basedate , shift)
returns true if date lies inside the part of month containing basedate up until and including the last millisecond of basedate. The month can be offset by shift. Shift is an integer, where the value 0 indicates the month which contains basedate. Negative values in shift indicate preceding months and positive values indicate succeeding months.
Examples:
inmonthtodate ( '2006-01-25', '2006-01-25', 0 ) returns true
inmonthtodate ( '2006-01-25', '2006-01-24', 0 ) returns false
inmonthtodate ( '2006-01-25', '2006-02-28', -1 ) returns true
best regards
chris