date formats in select statements
[prev]
[thread]
[next]
[Date index for 2004/11/23]
Hi,
could someone please help me shed some light on how to convert date format
in CDBI, not using set_sql?
I am not really sure how to use Class::Date or DateTime with CDBI. Sorry
I don't follow what the docs say about it.
I would need date format in either ' yyyymmdd; or 'hh:mm:ss' or both in my
select statements.
Up until now, I ended up using set_sql.
__PACKAGE__->set_sql( date_range => qq(
SELECT feed_id, trans_id,
CASE WHEN start_time is null
THEN convert(char(8), end_time, 112)
ELSE convert(char(8), start_time, 112)
END as ccyymmdd,
convert(char(8), start_time, 108) as start_hour,
convert(char(8), end_time, 108) as end_hour
FROM __TABLE__
WHERE feed_id = ?
and ((start_time between ? and dateadd(dd, 1, ?))
or (end_time between ? and dateadd(dd, 1, ?)))
order by ccyymmdd
));
Thank you,
IS
|
date formats in select statements
Isarin.Sathitruangsak 16:01 on 23 Nov 2004
|