i have a field 'Date' having value '16-JUN-2014'
i want only day from the date field i.e 16
tried day(date) it didnt worked
any suggestions are highly appreciated.
What about LEFT(Date,2)
It seems your date is not in date format then first convert it into date format
Day(Date(Date,'DD-MMM-YYYY')) as DDMMMYYYY_Day
You can achieve it various way
1) using date#()
day(date#(Date,'DD-MMM-YYYY')) as day
day(date(date#(Date,'DD-MMM-YYYY'))) as day
date(date#(Date,'DD-MMM-YYYY'),'DD') as day
2) using subfield()
subfield(date,'-',1) as day
it seems your using a string, not a date,
Retrieving data ...