Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Date range

jerryc1
6 - Meteoroid

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)

 

4 REPLIES 4
mceleavey
17 - Castor
17 - Castor

@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.



Bulien

Hollingsworth
12 - Quasar
12 - Quasar

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.

Hollingsworth_0-1623784421909.png

 

John Hollingsworth
Clear Channel Outdoor
jerryc1
6 - Meteoroid

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.

jerryc1
6 - Meteoroid

The date is already in my data and I used the date tool to covert to the desired format.

Labels
Top Solution Authors