In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date issue

TabsheerMohamed
7 - Meteor

Hi community!

I made workflow which has date field dynamic as today, and the workflow scheduled to run every day at 1:30 pm. The problem which comes in is it's not capturing anything entered after 1:30pm and next day it repeats the same way. Can someone please help me to find a solution(formula) which captures the data from today afternoon till tomorrow afternoon and when it run the file will take 24-hour time period from today afternoon till tomorrow afternoon.

THANKS IN ADVANCE

5 REPLIES 5
ShankerV
17 - Castor

Hi @TabsheerMohamed 

 

If I understand your question correctly, you might have used to datetimenow()

And then used datetimediff(date1, date2, "days")

So it will give diff as 1 day.

 

So there might be probability of data's getting missed out.

 

Try to use datetimediff(date1, date2, "hours")

Then use the file is <24 hours, then all the items from last afternoon till next afternoon will come.

 

To make more accurate, you can do in seconds also.

 

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @TabsheerMohamed 

 

Please use datetimenow() instead of datetimetoday()

That makes the big difference.

 

ShankerV_0-1675282663468.png

 

Note: Assuming the scenario based on the issue explained, hope this will work for you.

 

Many thanks

Shanker V

TabsheerMohamed
7 - Meteor

Yes, I will try it. The thing which I am trying to do; wanted to get whatever is entered from yesterday afternoon till today afternoon, and it should change every day.

Emmanuel_G
13 - Pulsar

@TabsheerMohamed 

 

I don't know if I really capture the issue. But in this workflow, you generate automatically data from today afternoon till tomorrow afternoon hour by hour.

 

Let me know if it is what you want.

 

Emmanuel_G_0-1675333241707.png

 

TabsheerMohamed
7 - Meteor

Thank you, Emmanuel! this works when I wanted to generate dates for future, but I am looking for something that will generate capture my existing data from yesterday until today afternoon, because my workflow runs about 1pm. I have made a query but it's not actually doing what I want if you can suggest me a fix would be a great help :)
Please find the query below:
DateTimeAdd("yyyy-MM-dd 13:00:00",-1,DateTimeNow())
AND DateTimeAdd("yyyy-MM-dd 13:00:00",0,DateTimeNow())

Thank you in advance :)

Labels
Top Solution Authors