6 Replies Latest reply: Mar 30, 2013 4:32 PM by Bradley Coyne

# Daystart Function -  time field

Hi.

Goal: Calculate all open tickets for a time intervall between 17:00 yesterday and 17:00 today;

(2) create this time intervall as one time field as "Today".

What i am assuming would be best is to use the daystart function. Here is the Pseudologic i am aiming to achieve.

open = date ticket was opened.

if  Date(Daystart(open > 17:00 (yesterday) & <17:00 (today)) = "Today".

is there anyone who has used this function for this purpose?

Best

• ###### Re: Daystart Function -  time field

Look up the InDay function in the help file. I think that's the function you're looking for. You can specify when a day starts in that function.

Something like InDay( open, today(), -1 , 17/24)

• ###### Re: Daystart Function -  time field

Hi Gsybert!

i have introduced the following code into the application (see below)

however it seems to make no difference to the count. I am wondering if the floor function cancels the timestamp on the date?

let

vToday = num (today(1));

inDay( Register, today(), 17/24) as Register,
floor(Register) as old,
Case

your help is greatly appreciated in this matter.

Best,

• ###### Re: Daystart Function -  time field

Yes, using the floor function on a datetime (aka timestamp) will remove the time part. Can you post the document you're working on or an example with sample data?

• ###### Re: Daystart Function -  time field

Hej Gysbert!

Here is the application I am working on as well as sample document;

Thanks again for your help, I appreciate it.

Best,

• ###### Re: Daystart Function -  time field

In your expression is missing the third parameter, making the fourth the third:

inDay(Reg_date, today(), 17/24) as NewDate,

Try inDay(Reg_date, today(), -1, 17/24) as NewDate,

See Sheet2 on the attached qvw for a some examples of counts using InDay

• ###### Re: Daystart Function -  time field

thanks a million!

Works great.

Best,