It's section 6.3.4 in the MySQL manual (v3.23.49) for date formats.
Excerpt follows.
HTH
Ray
DATE_FORMAT(date,format)
Formats the date value according to the format string. The following specifiers may be used in the format string:
| % M | Month name (January..December) |
| %W | Weekday name (Sunday..Saturday) |
| %D | Day of the month with English suffix (1st, 2nd, 3rd, etc.) |
| %Y | Year, numeric, 4 digits |
| %y | Year, numeric, 2 digits |
| %X | Year for the week where Sunday is the first day of the week, numeric, 4 digits, used with '%V' |
| %x | Year for the week, where Monday is the first day of the week, numeric, 4 digits, used with '%v' |
| %a | Abbreviated weekday name (Sun..Sat) |
| %d | Day of the month, numeric (00..31) |
| %e | Day of the month, numeric (0..31) |
| %m | Month, numeric (01..12) |
| %c | Month, numeric (1..12) |
| %b | Abbreviated month name (Jan..Dec) |
| %j | Day of year (001..366) |
| %H | Hour (00..23) |
| %k | Hour (0..23) |
| %h | Hour (01..12) |
| %I | Hour (01..12) |
| %l | Hour (1..12) |
| %i | Minutes, numeric (00..59) |
| %r | Time, 12-hour (hh:mm:ss [AP]M) |
| %T | Time, 24-hour (hh:mm:ss) |
| %S | Seconds (00..59) |
| %s | Seconds (00..59) |
| %p | AM or PM |
| %w | Day of the week (0=Sunday..6=Saturday) |
| %U | Week (0..53), where Sunday is the first day of the week |
| %u | Week (0..53), where Monday is the first day of the week |
| %V | Week (1..53), where Sunday is the first day of the week. Used with '%X' |
| %v | Week (1..53), where Monday is the first day of the week. Used with '%x' |
| %% | A literal `%'. |
At 22/01/2003 10:30 PM, you wrote:
Thanks Danny
I'm using mySQL and in this case the format you suggested didn't work but
it put me on the right path to find the answer.
Where does one find a reference to all the format arguments?
Peter
-----Original Message-----
From: "Danny Mallory" <[EMAIL PROTECTED]>
To: "sambar List Member" <[EMAIL PROTECTED]>
Date: Tue, 21 Jan 2003 21:12:55 -0600
Subject: [sambar] Off topic SQL sambar scripting {02}
> Have you tried using a format command in your sql string?
> Not sure on your database flavor but is very common to format the date
> as needed during the select.
>
> ie;
> select FORMAT([date],'mm/dd/yyyy') as Dateformatted
>
> Danny
>
> On 22/Jan/2003 02:09:42, Peter wrote:
> > I'm having a real problem with retrieving the results I want with
> sambar
> > scripting. I have been through 3 turotials and none have been any
> help so
> > I'm hoping someone here has an idea for me.
> >
> > In a nutshell I'm grouping byte counts on a daily basis from a table.
> The
> > querry below does what it should but the date format comes out
> 20030121
> > not a pretty 2003/01/21 if I remove the left() I get the full date
> time
> > which I don't want either.
> >
> > <RCQmylog sql="select left(tstamp,10),sum(bytes) from RC$tbl group by
> left
> > (tstamp,10);">
> > <RCwhile RCFmylog = 1>
> > <b>Traffic on:</b> <RCDmylog.1> - <i><RCDmylog.2></i> bytes<br>
> > <RCendwhile
> >
> > Regards
> > Peter
> > -------------------------------------------------------
> > To unsubscribe please go to <A TARGET="_blank"
> HREF="" href="" eudora="autourl">http://www.sambar.ch/list/">http://www.sambar.ch/list/</a>
> >
> >
> >
> -------------------------------------------------------
> To unsubscribe please go to http://www.sambar.ch/list/
>
>
-------------------------------------------------------
To unsubscribe please go to http://www.sambar.ch/list/
------------------------------------------------------- To unsubscribe please go to http://www.sambar.ch/list/
