Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
alec1982
Specialist II
Specialist II

Timestamp to number

hi all,

I am trying to load a set of files and then use incremental load to only load new files.

the first step I am trying to take is to load the file modified timestamp and transform it to number then use that number on the incremental load.

the issue is the logic I use doesn't return any number.

Here is my logic. Can someone please help me fix it and thank you in advance.

num(Date(DATE#(filetime(),'MM/DD/YYYY h:mm:ss TT'),'MM/DD/YYYY')) asTimeStampNum

Alec

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

Alec,

You can use the below function in textbox to test the result.

=Timestamp('42471,998385064')

The below script working fine in my system. Check the attachment.

Load *,

Num(DATE#(Filetime(),'MM/DD/YYYY h:mm:ss TT'))  as TimeStamp

From Source;

View solution in original post

19 Replies
engishfaque
Specialist III
Specialist III

Dear Alec1982,

Your given script for create new field "TimeStampNum" is working fine for me.

Can you share your sample App?

Kind regards,

Ishfaque Ahmed

Anonymous
Not applicable

Hi Alec,

What is the issue?

Anonymous
Not applicable

Hi Alec,

Give space after  'AS' . Its working for me

num(Date(DATE#(filetime(),'MM/DD/YYYY h:mm:ss TT'),'MM/DD/YYYY')) as TimeStampNum

Hope it helps!!

tamilarasu
Champion
Champion

Try,

Load *,

Num(Floor(Filetime(DocumentPath()))) as TimeStampNum

From Source;

alec1982
Specialist II
Specialist II
Author

hi Tamil,

this solution gives only the date number while I need the full timestamp number.

alec1982
Specialist II
Specialist II
Author

this gives me for example 42454,251875 for the time stamp 3/25/2016 6:02:42 am which I believe it is wrong..

alec1982
Specialist II
Specialist II
Author

this gives me for example 42454,251875 for the time stamp 3/25/2016 6:02:42 am which I believe it is wrong..

alec1982
Specialist II
Specialist II
Author

this gives me for example 42454,251875 for the time stamp 3/25/2016 6:02:42 am which I believe it is wrong..

alec1982
Specialist II
Specialist II
Author

thank you Tamil. I get 42471,998385064 for 3/25/2016 6:02:42 am.. How do I test if this value is correct..