Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I tried to change my date field from string to number.not able to resolve
please help me
Hi Sruti,
Some of the very simple way try this load script for date, month and year
LOAD cust_id,
date,
Date(Date#(date,'DD-MM-YYYY')) as Date,
Month(Date#(date,'DD-MM-YYYY')) as Month,
Year(Date#(date,'DD-MM-YYYY')) as Year,
sale,
Date(Date#("date",'DD-M-YYYY')) as NewDate,
Year(Date(Date#("date",'DD-M-YYYY'))) as NewYear,
MOnth(Date(Date#("date",'DD-M-YYYY'))) as NewMonth
From
practice.xlsx
(ooxml, embedded labels, table is Sheet1);
=Date(Date#(date,'DD-M-YYYY'))
and
=NUM(Date(Date#(date,'DD-M-YYYY')))
try below
Alt( Date(Date#( [date] , 'DD-MM-YYYY' ),'DD-MM-YYYY'),
Date(Date#( [date] , 'DD-M-YYYY'),'DD-MM-YYYY')) AS NewDate,
Regards
ASHFAQ
Attachement!
= date(date#(date,'ddmmyyyy'))
i want to dervie month and year fields how can i get that?
Date(num(Date#([date] ,'DD-MM-YYYY')),'DD-MM-YYYY') as new_date,
can be written in an easier way like:
Date(Date#([date] ,'DD-MM-YYYY'),'DD-MM-YYYY') as new_date,
Month(Date#([date] ,'DD-MM-YYYY')) as new_Month,
Year(Date#([date] ,'DD-MM-YYYY')) as new_Year,
year(= date(date#(date,'ddmmyyyy'))) as year,
month(= date(date#(date,'ddmmyyyy'))) as month
Like this.
LOAD cust_id,
date,
Date(Date#(date,'DD-MM-YYYY')) as Date,
Month(Date#(date,'DD-MM-YYYY')) as Month,
Year(Date#(date,'DD-MM-YYYY')) as Year,
sale
From
practice.xlsx
(ooxml, embedded labels, table is Sheet1);
Regards
ASHFAQ
Hi Sruti,
Some of the very simple way try this load script for date, month and year
LOAD cust_id,
date,
Date(Date#(date,'DD-MM-YYYY')) as Date,
Month(Date#(date,'DD-MM-YYYY')) as Month,
Year(Date#(date,'DD-MM-YYYY')) as Year,
sale,
Date(Date#("date",'DD-M-YYYY')) as NewDate,
Year(Date(Date#("date",'DD-M-YYYY'))) as NewYear,
MOnth(Date(Date#("date",'DD-M-YYYY'))) as NewMonth
From
practice.xlsx
(ooxml, embedded labels, table is Sheet1);