Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I can't get Date to show me YEAR MONTH DAY
My script:
I use this script and it run Okay - import from a file on a homepages but it is the same if I try to import from the computer C:\xxx.txt
Tab1:
Load *, Month(Dato) as Måned;
Load *, Year(Dato) as År;
Load *, Day(Dato) as Dag;
Load
@1 as Nummer,
@2 as KundeID,
@3 as Type,
@4 as IPadresse,
@5 as Dato
FROM
My data - some of it taken from Notepad-file.
463,170,4,66.249.65.243,15:34:42 27-04-2010
1297,679,2,212.242.59.140,15:35:10 27-04-2010
1297,679,3,212.242.59.140,15:35:14 27-04-2010
1297,679,2,212.242.59.140,15:35:46 27-04-2010
583,289,2,207.46.199.46,15:39:57 27-04-2010
The result
I would be very greatfull if there is anyone who have the answer
Thank you
Best regards
John Thinggaard Andersen
Hey John,
Not sure if you have the script right.
I see that you have the Year, Month and Day before loading the date from the text file.
I'd assume it has to be done after loading the data from the text file.
Or try that
Tab1:
Load
@1 as Nummer,
@2 as KundeID,
@3 as Type,
@4 as IPadresse,
@5 as Dato,
Month(@5) as Måned;
Load *, Year(@5) as År;
Load *, Day(@5) as Dag;
FROM
Hi Rocky
I did not change anything and I have others scipt where it is ok to have it before the data
I think that there is a problem about that the timestamp is before the date because I have a similar file who works fine and here the date is before the timestamp.
Thank you for your answer
Have a nice day
Best regards
John
Hi Seif eddine
It did nok solve my problem - It will not accept @5 it has to be Dato!
I think that there is a problem about that the timestamp is before the date because I have a similar file who works fine and here the date is before the timestamp.
Thank you for your answer
Have a nice day
Best regards
John
Have you tried something in the line with (it works for me in my application)
num(Year(Dato)) as Year,
num(Month(Dato)) as Month,
num(Day(Dato)) as Day,
John,
The script doesn't recognize this format as date/time. You have to define it explicitly:
timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')
So, it may be like this:
date(timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')) as Date,
month(timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')) as Month,
Year(timestamp#(Dato, 'hh:mm:ss DD-MM-YYY')) as Year,
...