Ask a Question related to PHP Development, Design and Development.
-
Albert Ahtenberg #1
Mysql query
Hi,
I have a database with a date field. And I would like to see the report
grouped by a ceratin month and year, how can I do that without multiple
queries?
Albert Ahtenberg
Albert Ahtenberg Guest
-
Is this a MySQL Query bug?
I wrote a SQL script in MySQL Query, and saved it as script.sql, but when I executed it in windows command line "mysql -h localhost -u root... -
MySQL Query Cache Not Working: MySQL 5 / Windows XP
Please excuse this post if you've already read it on mailing.database.mysql - i just discovered these other groups. future posts will be... -
MYSQL query: AND OR?
This will probably sound stupid. How would you do a MYSQL query that was to evaluate if either condition A or B was meet? And if so, in what... -
MySql query help
Hey, I am trying to retrive information from a database using the 'Mysql_fetch_assoc' function, but the problem is.. it is just one row of data... -
Query log for mySQL?
Is there a simple way to create a query log for mySQL? I've been asked^h^h^h^h^h told to add a layer of auditing on an existing application. It's... -
Steven James Samuel Stapleton #2
Re: Mysql query
What format is the date field stored in?
Is there a day, month, and year field (separate)?
Is it a timestamp?
Is it something else?
-Jim Stapleton
"Albert Ahtenberg" <donotcontact@this.address> wrote in message
news:bdhud4$tev$1@tabloid.uwaterloo.ca...> Hi,
>
> I have a database with a date field. And I would like to see the report
> grouped by a ceratin month and year, how can I do that without multiple
> queries?
>
> Albert Ahtenberg
>
>
Steven James Samuel Stapleton Guest
-
Albert Ahtenberg #3
Re: Mysql query
It is the MySql DATE type. looks like (DD-MM-YYYY).
"Steven James Samuel Stapleton" <stapleton.41@mps.ohio-state.edu> wrote in
message news:mcgHx12drhfu@ohstpy...> What format is the date field stored in?
>
> Is there a day, month, and year field (separate)?
> Is it a timestamp?
> Is it something else?
>
> -Jim Stapleton
>
> "Albert Ahtenberg" <donotcontact@this.address> wrote in message
> news:bdhud4$tev$1@tabloid.uwaterloo.ca...>> > Hi,
> >
> > I have a database with a date field. And I would like to see the report
> > grouped by a ceratin month and year, how can I do that without multiple
> > queries?
> >
> > Albert Ahtenberg
> >
> >
>
Albert Ahtenberg Guest
-
Mike Vore #4
Re: Mysql query
First get a real email address if you want real replies.
On Fri, 27 Jun 2003 20:54:25 -0400, Albert <donotcontact@this.address> wrote:^^^^^^^^^^> It is the MySql DATE type. looks like (DD-MM-YYYY).
This isn't a MySQL date format.
select * from mydatabase where datefield like "2003-07%";
This works for me.
>
> "Steven James Samuel Stapleton" <stapleton.41@mps.ohio-state.edu> wrote in
> message news:mcgHx12drhfu@ohstpy...>>> What format is the date field stored in?
>>
>> Is there a day, month, and year field (separate)?
>> Is it a timestamp?
>> Is it something else?
>>
>> -Jim Stapleton
>>
>> "Albert Ahtenberg" <donotcontact@this.address> wrote in message
>> news:bdhud4$tev$1@tabloid.uwaterloo.ca...>>>> > Hi,
>> >
>> > I have a database with a date field. And I would like to see the report
>> > grouped by a ceratin month and year, how can I do that without multiple
>> > queries?
>> >
>> > Albert Ahtenberg
>> >
>> >
>>
>
--
Michael Vore, W3CCV M-ASA [Ka8]; WHIRL, ABC; CAW, CW, AAW
[url]http://mike.vorefamily.net/ohmywoodness[/url] <-Custom Woodworking
[url]http://mike.vorefamily.net/thewoodenradio[/url] <-The weblog
Mike Vore Guest
-
Albert Ahtenberg #5
Re: Mysql query
Mike,
Regarding my Email address, I got so much spam when I posted my Email
address on this forum so I decided not to. Besides, I can't see the
relevancy of my Email to this at all.
Now, what you suggest will choose all the records with the date July/03.
What I need is not to have them selected by the date but grouped by a
certain date. I will give you an example. Suppose I have a 'date' field and
a 'sum' field. What I need is a report about the total sum in each month.
And I wonder what is the most simple way to do it.
Regards,
Albert Ahtenberg
"Mike Vore" <mvore@ix.netcom.cam> wrote in message
news:slrnbfr1ln.sqp.mvore@snowmass.mystic.ct...wrote:>
> First get a real email address if you want real replies.
>
> On Fri, 27 Jun 2003 20:54:25 -0400, Albert <donotcontact@this.address>in> ^^^^^^^^^^> > It is the MySql DATE type. looks like (DD-MM-YYYY).
> This isn't a MySQL date format.
>
>
> select * from mydatabase where datefield like "2003-07%";
>
> This works for me.
>
>> >
> > "Steven James Samuel Stapleton" <stapleton.41@mps.ohio-state.edu> wrotereport> > message news:mcgHx12drhfu@ohstpy...> >> What format is the date field stored in?
> >>
> >> Is there a day, month, and year field (separate)?
> >> Is it a timestamp?
> >> Is it something else?
> >>
> >> -Jim Stapleton
> >>
> >> "Albert Ahtenberg" <donotcontact@this.address> wrote in message
> >> news:bdhud4$tev$1@tabloid.uwaterloo.ca...
> >> > Hi,
> >> >
> >> > I have a database with a date field. And I would like to see themultiple> >> > grouped by a ceratin month and year, how can I do that without>> >> >> > queries?
> >> >
> >> > Albert Ahtenberg
> >> >
> >> >
> >>
> >>
> >
>
> --
> Michael Vore, W3CCV M-ASA [Ka8]; WHIRL, ABC; CAW, CW, AAW
> [url]http://mike.vorefamily.net/ohmywoodness[/url] <-Custom Woodworking
> [url]http://mike.vorefamily.net/thewoodenradio[/url] <-The weblog
Albert Ahtenberg Guest
-
Pedro #6
Re: Mysql query
Albert Ahtenberg wrote:
maybe>> select * from mydatabase where datefield like "2003-07%";
select year(datefield), month(datefield), sum(valuefield)
from table
group by year(datefield), month(datefield)
HTH
--
"Yes, I'm positive."
"Are you sure?"
"Help, somebody has stolen one of my electrons!"
Two atoms are talking:
Pedro Guest



Reply With Quote

