Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
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