jet47

Hints on converting this VB to Python to use in script.

Discussion created by jet47 on Aug 18, 2011
Latest reply on Jul 8, 2012 by kimo
I need to know what to define and how to subtract days from a date field.

DATE_EXPIR and TodaysDate are date fields written in month, day, year.

The following works in field calculator in 9.3, but I need to use it in a python script.

Dim status as string
  If [DATE_EXPIR]<[TodaysDate] - 365 Then
  status = "old"
 
  ElseIf [DATE_EXPIR]<[TodaysDate] and [DATE_EXPIR]>=[TodaysDate]-365 Then
  status = "recent"

  Else
  status = "active"

  EndIf

Any help is appreciated.

Thanks,
Josh Turner

Outcomes