If you want to convert from text/string into date format, you can use the DATE# function, which I think will result in the time data to be lost.
So in your case, I think it should be like this:
DATE#( record_date, 'M/D/YYYY HH:MM' ) AS date;
I haven't actually tested if you can force DATE# on a timestamp string, but if QlikView can't, then you can just use TIMESTAMP# combined with DATE:
DATE( TIMESTAMP#( record_date, 'M/D/YYYY HH:MM' ), 'M/D/YYYY' ) AS date;
Of course you can just use only TIMESTAMP# and set your default Numbering Format of that field to just show the date (via Document Settings or individually on each object/chart you're using that field in).
In the format string, you need hh:mm instead of HH:MM. MM stands for the month, not the minute. Lower case gives you the minute. When reading in a timestamp, use the timestamp# function. You could use string functions to strip off the time, then use the date# function, but I'd just use the timestamp# function. However, you can't just wrap that in a date() function. Date() is a FORMATTING function, and will not change the underlying data, so you will still have a timestamp including the time, even if it displays as a date. Use floor() or daystart() to remove the fractional part. Or if by "remove the time" your meant "create a time field", that's basically the same thing, but with time() and frac().
,date(floor(timestamp#(record_date,'M/D/YYYY hh:mm'))) as record_date
,time(frac (timestamp#(record_date,'M/D/YYYY hh:mm'))) as record_time
sorry to bring up a 'dead' topic.
I am also dealing with a timestamp field, which I need to split in date and time, so to check the time against a cutoff time.
I was applying the formulas suggested by Witherspoon and crushing my head because I could not get any data out of it.
I thought the problem was in the source data, cos I could not really get a hang if it was DD-MM-YYYY, DD/MM/YY etc.etc. (it changed depending on the programs I used to open the dataset)
then I tried these formulas
num(floor(CreationDate)) as numDateFLOOR,
num(frac(CreationDate)) as numDateFRAC,
I was 'surpised' it worked like a charm on the first try
and I could directly compare them with the cutoff time, mapped like this
'15:00' as Cutoff
just posting it here in case someone is facing the same troubles!