Hi Peter,

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:
%  MMonth name (January..December)
%WWeekday name (Sunday..Saturday)
%DDay of the month with English suffix (1st, 2nd, 3rd, etc.)
%YYear, numeric, 4 digits
%yYear, numeric, 2 digits
%XYear for the week where Sunday is the first day of the week, numeric, 4 digits, used with '%V'
%xYear for the week, where Monday is the first day of the week, numeric, 4 digits, used with '%v'
%aAbbreviated weekday name (Sun..Sat)
%dDay of the month, numeric (00..31)
%eDay of the month, numeric (0..31)
%mMonth, numeric (01..12)
%cMonth, numeric (1..12)
%bAbbreviated month name (Jan..Dec)
%jDay of year (001..366)
%HHour (00..23)
%kHour (0..23)
%hHour (01..12)
%IHour (01..12)
%lHour (1..12)
%iMinutes, numeric (00..59)
%rTime, 12-hour (hh:mm:ss [AP]M)
%TTime, 24-hour (hh:mm:ss)
%SSeconds (00..59)
%sSeconds (00..59)
%pAM or PM
%wDay of the week (0=Sunday..6=Saturday)
%UWeek (0..53), where Sunday is the first day of the week
%uWeek (0..53), where Monday is the first day of the week
%VWeek (1..53), where Sunday is the first day of the week. Used with '%X'
%vWeek (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/


Reply via email to