I am trying to insert a date range into the model that allows user to insert a start date and end date. Below are the formulas and error message I am getting.
[Application Date]<= DateTimeStart() and [Application Date]>= DateTimeNow()
IF [APPLN_DATE]>= DateTimeStart() and [APPLN_DATE]<= DateTimeNow() Then [APPLN_DATE] ="TRUE"
ELSE [APPLN_DATE] = "False"
ENDIF
The formula "Application Date" resulted in a number but the field is a Date/Time. (Expression #1)
Solved! Go to Solution.
@jerryc1 ,
if you're creating the field [Application Date] in a formula tool you need to change the data type to be datetime. Currently it's numeric.
If it's already in your data, you will need to convert it using a formula or a Date tool to ensure it's a datetime field.
M.
Some other thoughts:
- If you are only trying to do date comparisons, then you can use DateTimeToday() to return just the date and not the time portion.
- To follow up on @mceleavey 's advice, you may need to use the DateTimeParse() function (shown in the image below) if your date field is in some format other than ISO, YEAR-MO-DA.
I am trying to use a date range ( start date - end date). My data has a column with dates (application date) and I want to be able to allow user of the model to be able to input their date range.
The date is already in my data and I used the date tool to covert to the desired format.