Code: Select all
{Users.ExpiryDate > Today}
When using the Designer, I look at the Data Sources, pick the Users table, ExpiryDate is not showing as a datetime field but alpha [abc], probably due to the conversion to JSON when loading.
So then I presumed that I would need to change the above expression to
Code: Select all
{Convert.ToDateTime(Users.ExpiryDate) > Today}
So I then converted the field to a date using the following expression:
Code: Select all
{DateSerial(TryParseLong(Substring(Users.ExpiryDate.ToString("yyyy-MM-dd"),0,4)),TryParseLong(Substring(Users.ExpiryDate.ToString("yyyy-MM-dd"),5,2)), TryParseLong(Substring(Users.ExpiryDate.ToString("yyyy-MM-dd"),8,2))) > Today}
1. Where is the "Check" button in the Filter DataBand Expression screen (to validate expressions)? Also why do expressions need {} to surround but filter expressions dont need {}.
2. Why cannot compare Convert.ToDateTime(Users.ExpiryDate) to the function Today? It seems that Users.ExpiryDate cannot be converted into a date, except by using DateSerial.
3. Surely the DateSerial() function API reference should say DateSerial(year, month, day) rather than DateSerial(int64, int64, int64) it would be more readable (same applies to other functions).