Extract Day of Week from Datetime
Posted in 2000
Topics: Data Types & Schema Design
Is it possible to extract the Day of Week from a datetime data type column or determine the day of week with the current keyword? If I quantify datetime column with DAY I get the day of month. Can I get the way of week? EX: day(current) will return 19 today, can I get Tuesday or a value 1 (or 0) to 7 (or 6) with a 2 being Tuesday. Thanks, Frank Sent via Deja.com http://www.deja.com/
Use weekday(current), where 0 represents Sunday Erickson In article <91ofl6$eoo$1@nnrp1.deja.com>, nyc_ezrider@my-deja.com wrote: > Is it possible to extract the Day of Week from a datetime data type > column or determine the day of week with the current keyword? If I > quantify datetime column with DAY I get the day of month. Can I get the > way of week? > > EX: day(current) will return 19 today, > can I get Tuesday or a value 1 (or 0) to 7 (or 6) with a > 2 being Tuesday. > > Thanks, > Frank > > Sent via Deja.com > http://www.deja.com/ > Sent via Deja.com http://www.deja.com/
SELECT TO_CHAR(CURRENT,'%A') FROM systables where tabid=1; In article <91ofl6$eoo$1@nnrp1.deja.com>, nyc_ezrider@my-deja.com wrote: > Is it possible to extract the Day of Week from a datetime data type > column or determine the day of week with the current keyword? If I > quantify datetime column with DAY I get the day of month. Can I get the > way of week? > > EX: day(current) will return 19 today, > can I get Tuesday or a value 1 (or 0) to 7 (or 6) with a > 2 being Tuesday. > > Thanks, > Frank > > Sent via Deja.com > http://www.deja.com/ > Sent via Deja.com http://www.deja.com/