Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: stonysmithFor readability, you can break up the expression into two variables:
d=str(dateAdjust(date(),-13,"months"))
disedate=int("1" + substr(d,2,2) + substr(d,5,2) + substr(d,8,2))
This also has the effect of only doing the DateAdjust operation once.. instead of 3 times, so it's faster.
For reference, in a DBExecute node you can do all of this as a single step:
#build the date string
d=str(dateAdjust(date(),-13,"months"))
disedate=int("1" + substr(d,2,2) + substr(d,5,2) + substr(d,8,2))
#build and execute the query
query = "Select * from [TableName] where date >= :1"
sqlSelect(1,query,disedate)