want to read from a database using php commands and grouping by
timetype jobdatefrom endyear and nctype and summing the groups for
everymonth but instead it sums up for all the months. Here are the
Codes i wrote for that:
$query = mysql_query("select distinct sum(ChargeTime) as ChargeTime,
sum(Amount) as AmounT , ClientName,
JobDateFrom,JobDateTo,endYear,NcType from jobs where TimeType=0 group
by TimeType, JobDateFrom, endYear, NcType having
JobDateFrom>=Date('$startdate') and JobDateTo=('$enddate')");
thats the query i am using. Can anyone help me on this?? Its an urgent
matter. thank you!! 2 1247
Asembereng wrote:
want to read from a database using php commands and grouping by
timetype jobdatefrom endyear and nctype and summing the groups for
everymonth but instead it sums up for all the months. Here are the
Codes i wrote for that:
$query = mysql_query("select distinct sum(ChargeTime) as ChargeTime,
sum(Amount) as AmounT , ClientName,
JobDateFrom,JobDateTo,endYear,NcType from jobs where TimeType=0 group
by TimeType, JobDateFrom, endYear, NcType having
JobDateFrom>=Date('$startdate') and JobDateTo=('$enddate')");
thats the query i am using. Can anyone help me on this?? Its an urgent
matter. thank you!!
Since you're asking how to compose a SQL query, I suggest you try a SQL
newsgroup - like comp.databases.mysql.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. js*******@attglobal.net
==================
On 21 Aug, 13:02, Asembereng <mljarj...@gmail.comwrote:
want to read from a database using php commands and grouping by
timetype jobdatefrom endyear and nctype and summing the groups for
everymonth but instead it sums up for all the months. Here are the
Codes i wrote for that:
$query = mysql_query("select distinct sum(ChargeTime) as ChargeTime,
sum(Amount) as AmounT , ClientName,
JobDateFrom,JobDateTo,endYear,NcType from jobs where TimeType=0 group
by TimeType, JobDateFrom, endYear, NcType having
JobDateFrom>=Date('$startdate') and JobDateTo=('$enddate')");
thats the query i am using. Can anyone help me on this?? Its an urgent
matter. thank you!!
Whilst you should be asking this in an SQL group...
Which of the fields
TimeType, JobDateFrom, endYear, NcType
contains months? This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cocoalearner |
last post by:
I am serving a website using apache. All the php and mysql code I have
written works, except for one thing. When I try to create a database
named M#2 using the following call, no database is...
|
by: Hugo Fjelsted Alrøe |
last post by:
I am fairly new at MySQL, so please excuse any ignorance.
We are using MySQL (version 3.23.48) in connection with an Eprints =
archive. We have non-english deposits in the archive, and...
|
by: Bennett Haselton |
last post by:
I'm trying to port my MySQL tables for a database called "tracerlock" from
one server to another. On the old server, in the /var/lib/mysql/tracerlock
directory, there was a ".MYD", ".MYI" and...
|
by: phillip.s.powell |
last post by:
We're looking at a GUI interface for our MySQL DB and I am interested
in MySQL Administrator, however, one of our requirements is to be able
to import/export databases. Is this possible or do I...
|
by: so many sites so little time |
last post by:
all right so the script is pretty simple it goes it retrives what the
id of the post is and it lets you edit it well no it doesnt.
now if you go to www.kirewire.com/pp2/index/php you will see a...
| |
by: crazydrummer |
last post by:
hi everyone, fairly new to access and VBA, but have fundamental knowledge.
as part of a college project i am building a database that records "downtime" for machines in a company.
the...
|
by: Siong.Ong |
last post by:
Dear all,
my PHP aims to update a MySQL database by selecting record
one by one and modify then save.
Here are my PHP, but I found that it doesnt work as it supposed to be,
for example, when...
|
by: davy.zou |
last post by:
I found the code for a program that is suppose to be able to work out
the sumation of i from 1 to a certain integer n.
however, when I implemented to code into Visual C++, it doesn't work.
The...
|
by: Atli |
last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t.
In situations where your PHP application...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |