Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I am trying to use a timestamp and trying to extract the month, year and day but for some reason, I am not successful
one thing I have noticed is the Time stamp is showing commas in the text field
this is the following code i am using
GI_PVX:
LOAD [Item code] As REF,
[Item name],
[Date timestamp] as PVX_DATE,
Year(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_YEAR,
Month(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_MONTH,
Day(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_DAY,
FROM
(ooxml, embedded labels);
Please help me on this.
Regards,
M Talal
Hi Everyone,
Thank you so much for trying really appreciate your time and effort:
Finally the following code has worked,
GI_PVX:
LOAD [Item code] As REF,
[Item name],
// date(Date#([Date timestamp],dd/mm/yyyy)),
Replace( PurgeChar([Date timestamp],chr(39) ),',',';') as PVX_DATE,
Year(TimeStamp#(Replace( PurgeChar([Date timestamp],chr(39) ),',',';'),'DD/MM/YYYY hh:mm')) As PVX_YEAR,
Month(TimeStamp#(Replace( PurgeChar([Date timestamp],chr(39) ),',',';'),'DD/MM/YYYY hh:mm')) As PVX_MONTH,
Day(TimeStamp#(Replace( PurgeChar([Date timestamp],chr(39) ),',',';'),'DD/MM/YYYY hh:mm')) As PVX_DAY,
User,
From,
To,
Quantity,
Comments,
[From Container],
[To Container],
[Attribute 3],
[Attribute 4],
[Attribute 5],
[Attribute 6]
FROM
(ooxml, embedded labels);
I took this code =Replace( PurgeChar( vVariable ,chr(39) ),',',';') from stephan1983.
Regards,
M Talal
Try This
GI_PVX:
LOAD [Item code] As REF,
[Item name],
[Date timestamp] as PVX_DATE,
Year(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_YEAR,
Month(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_MONTH,
Day(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_DAY;
Load
[Item code],
[Item name],
Replace([Date timestamp],''','') as Date timestamp
FROM
(ooxml, embedded labels);
How was the [Date timestamp] Date values looking?
Hi Anil,
'01/04/2017 10:51'
as you can see in the snap shot of ListBox in highlighted green color.
Regards,
M Talal
Hi Aar,
I tried it its not working.
Thanks.
M Talal
Can you please tell me
when you try above code what is it giving you ??
Hi,
it shows no result after load and all the tables below this code does not load either.
may be a format problem somewhere.
How about this
GI_PVX:
LOAD *,
Year(PVX_DATE) As PVX_YEAR,
Month(PVX_DATE) As PVX_MONTH,
Day(PVX_DATE) As PVX_DAY;
LOAD [Item code] As REF,
[Item name],
Date(Floor(TimeStamp#(PurgeChar([Date timestamp], Chr(39)), 'DD/MM/YYYY hh:mm'))) as PVX_DATE
FROM
(ooxml, embedded labels);
Sorry about that
Can you try like these and check
GI_PVX:
LOAD [Item code] As REF,
[Item name],
[Date timestamp] as PVX_DATE,
Year(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_YEAR,
Month(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_MONTH,
Day(TimeStamp#([Date timestamp],'DD/MM/YYYY hh:mm')) As PVX_DAY;
Load
[Item code],
[Item name],
Replace([Date timestamp],chr(39),'') as [Date timestamp]
FROM
(ooxml, embedded labels);
Sample attached