Help with casting timestamp column
Help with casting timestamp column
От:
"Chris Hoover" <revoohc@sermonaudio.com>
Дата:
I need a bit of help. I have a table full of database stats that are all timestamped using the now() timestamp. However, I need to pull some consolidated reports that are based upon hourly activiy. Does anyone know of a way to get a timestamp column to return as mm/dd/yyyy hh? Thanks for any help, chris
Re: Help with casting timestamp column
От:
Chris Gamache <cgg007@yahoo.com>
Дата:
select to_char(my_timestamp,'MM/DD/YYYY HH') from t; returns a string representation of the timestamp... HTH, CG --- Chris Hoover wrote: > I need a bit of help. I have a table full of database stats that are > all timestamped using the now() timestamp. However, I need to pull some > consolidated reports that are based upon hourly activiy. Does anyone > know of a way to get a timestamp column to return as mm/dd/yyyy hh? > > Thanks for any help, > > chris > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/
Re: Help with casting timestamp column
От:
Janet Borschowa <borschow@roguewave.com>
Дата:
Check out the EXTRACT and date_part functions. See the PostgreSQL User's Guide for more information. -- Janet > -----Original Message----- > From: Chris Hoover [mailto:revoohc@sermonaudio.com] > Sent: Thursday, June 10, 2004 10:38 AM > To: pgsql-odbc@postgresql.org > Subject: [ODBC] Help with casting timestamp column > > > I need a bit of help. I have a table full of database stats that are > all timestamped using the now() timestamp. However, I need > to pull some > consolidated reports that are based upon hourly activiy. Does anyone > know of a way to get a timestamp column to return as mm/dd/yyyy hh? > > Thanks for any help, > > chris > > > ---------------------------(end of > broadcast)--------------------------- > TIP 8: explain analyze is your friend >
Re: Help with casting timestamp column
От:
Janet Borschowa <borschow@roguewave.com>
Дата:
See also the function to_char. -- Janet > -----Original Message----- > From: Chris Hoover [mailto:revoohc@sermonaudio.com] > Sent: Thursday, June 10, 2004 10:38 AM > To: pgsql-odbc@postgresql.org > Subject: [ODBC] Help with casting timestamp column > > > I need a bit of help. I have a table full of database stats that are > all timestamped using the now() timestamp. However, I need > to pull some > consolidated reports that are based upon hourly activiy. Does anyone > know of a way to get a timestamp column to return as mm/dd/yyyy hh? > > Thanks for any help, > > chris > > > ---------------------------(end of > broadcast)--------------------------- > TIP 8: explain analyze is your friend >