Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Count Time


I am using at Home the XAMPP installation where i have Mysql 5.0.51a. On the Webserver is the version 5.0.32

My SELECT ist:

SELECT cz.id_stammdaten, st.nachname, st.vorname, sum(TIMESTAMPDIFF(minute,start,ende)) AS anwesend
FROM cashzeiten cz
INNER JOIN stammdaten st ON st.id = cz.id_stammdaten
WHERE cz.ende <> '0000-00-00 00:00:00'
GROUP BY cz.id_stammdaten

On my Home-Installation it works. On the Webserver it doesn't works




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Use Count And Join At The Same Time
How to use count and join in the same time?

View Replies !   View Related
Looking For Query To Get Time Of Last Column Count Increase
Code:

id | time | units
------------------------------------
1 | 2009-01-06 06:52:32 | 50
1 | 2009-01-02 16:45:23 | 50
1 | 2009-01-02 09:12:16 | 40
1 | 2009-01-01 12:06:00 | 35
2 | 2009-01-04 14:52:30 | 259
2 | 2009-01-04 04:52:30 | 258
2 | 2009-01-03 18:00:01 | 258

I need to write a query that will, for each unique id, return the last time there was an increase in the "units" column. So for this data set, I want to see:

Code:

id | time
------------------------------------
1 | 2009-01-02 16:45:23
2 | 2009-01-04 14:52:30

View Replies !   View Related
Row Count Mismatch In Select Count(*) And Explain Select Count(*) From Table
mysql> explain select * from parameter;
+----+-------------+-----------+------+---------------+------+---------+------+------+-------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-----------+------+---------------+------+---------+------+------+-------+
| 1 | SIMPLE | parameter | ALL | NULL | NULL | NULL | NULL | 3354 | |
+----+-------------+-----------+------+---------------+------+---------+------+------+-------+
1 row in set (0.00 sec)

mysql> select count(*) from parameter;
+----------+
| count(*) |
+----------+
| 97 |
+----------+
1 row in set (0.00 sec)

View Replies !   View Related
PHP/MySQL Sorting By Date & Time (using Non Military Time)
This is probably a simple issue but I have searched online and can't find an answer.

I am using PHP/MySQL and I guess the most intuitive would be to have three select boxes containing HOUR / MINUTE / AM,PM option. Then store the time into mysql using there functions so I can output the data sorting them all by date and time. All the examples I have seen are for military time only but I'm sure there has got to be a simple mysql function or php function that converts non military to military and a formatting function to display with the AM / PM. But I have not found it.


View Replies !   View Related
Compare Time Posted With Current Time Not Working
May I know how to get records with interval of 1 hour in database where the posting time is in this format '2008-05-15 00:10:40'

I tried with this :

$query="SELECT date,name FROM message WHERE (timediff(date,NOW())<=CRUDATE() CURTIME())";

But is not working. May I know what is the correct way of doing it?

View Replies !   View Related
Different Timestamps For Time Of Creation And Time Of Update
What is the syntax to be used in MySQL when you want one timestamp to be set when the record is created, and the other only when it is updated?

I tried something like that but got a syntax error.

View Replies !   View Related
#1136 - Column Count Doesn't Match Value Count At Row 1
I'm getting the above error with the following SQL Statement. I cannot seem to find the error in the code. The select statement does pull multiple rows.

I'm using my SQL version: 4.1.19

Any clue on why this isn't working?

INSERT INTO `Grants` ( `Project_Code` , `Grant_Code` , `Fiscal_Year` , `Capital` )
VALUES (
(
SELECT Project_Code, Grant_Code, FY, SUM( Capital )
FROM Grants_Temp
WHERE Project_Code = 'OSUT'
AND FY = '2006'
AND Claim_Month = '072006'
GROUP BY Grant_Code
ORDER BY Grant_Code
)
)

View Replies !   View Related
Trying To Get Total Count Plus Count From WHERE Clause In One Query
I am fairly familiar with mysql, have been using it with php for about a year now for my development work. One query I am stuck on is the following. I am doing reporting, and need to find the count from a WHERE clause compared to the total count for that group. For the sake of an example, let's say I have a prize table that contains a complete list of prizes. There is a column to list if the prize has been won or not (prizeUsed - Y or N) and another that has the prize name (prizeName - string). I want the final result to list something like:

Total Prizes ____________________ 100 of 850 ......

View Replies !   View Related
Column Count Doesn't Match Value Count At Row 1
I am getting the following error when I run my query.

Column count doesn't match value count at row 1

I have looked up this error and have checked and I appear to have the right number and names in my query. In the DB table I have 34 columns, and that is what I have in the query.

The last 4 in the query are for the names of the images being uploaded, but am not sure how this all works, so I don't know if I need them, but have them there until I know for sure. Comment, Purchase and Remarks are not used in this form, but I have added them so everything is being shown in the query. Code:

View Replies !   View Related
Column Count Doesn't Match Value Count At Row 1 ...
I don't even know what to do to start fixing it.

"Column count doesn't match value count at row 1"

View Replies !   View Related
Minutes + TIME = TIME Function
I need some way to convert minutes (e.g. 80 mins) to SQL TIME (e.g. 01:20:00) in order to add it to another TIME var.

Is there any way to do this? I really dont want to convert my whole db. Basically, I want to do: e.g. 80 + 10:00:00 = 11:20:00.

View Replies !   View Related
How To Retrieve Mean Time Between Time Stamps
I have a table that stores failure information of external application. The time stamp of every failure event is stored. Now I'd like to make some system performance & reliability statistics calculations based on time stamps in certain recordset; mean time between failure MTBF, down time DT, etc.

Example:

2007-09-27 12:23:52
2007-09-27 08:50:23
2007-09-26 23:31:34
2007-09-26 21:45:33

Here the times between are (hours:mins): 3:33, 9:18, 1:46 and MTBF=4:52

Any effective possibility to make this example within a single query - or a procedure is needed?

View Replies !   View Related
Time Format Military Time
I know the time format it HH:MM:SS in mysql but can I input military time?
reason I can is that I want to later extract that information for calculations and military time is easier to work with.

View Replies !   View Related
Date-time Overlaps Another Time
had a time question in mysql...
i have a start and end time for a meeting table and i am comparing whether a new meeting conflicts with another meeting in same room on the same date.
i was wondering if i could check whether the 'date-time duration' in anyway overlaps another meetings date-time duration. visualized below...
............|____compareToThisMeeting__|
.....|_________meetingNewOverlaps__________|
i was doing something dumb before i realized i needed soemthing more complex (checking whether the start time of new meeting was 'BETWEEN' the start and end times of a meeting and whether the end time time is as well but i forgot the duration/middle value hehe).
(using asp)
and just returning booleans with a mySQL SELECT statement is what i am looking for like...
//within a loop in asp for meetings on same date/room
"SELECT '"+ year+"-"+month +"-"+day +" " + startHourString +":" + startMinuteString +":00''"+ " BETWEEN '"+ thisMeetingStart +"' AND '"+ thisMeetingEnd +"'"; (this doesnt cover the 'middle' overlap areas though)

View Replies !   View Related
Time And The Change Of Time For The Summer
I have a xampp server with mysql and php. A few days ago the time changed to the "summer time", one hour plus but the curtime() of mysql did not change.

Is there a way to change also this curtime() automatically?

View Replies !   View Related
Count(*) And ORDER By The Result Of Count
I want here to make a query which will reuse the result of a count(*) function.

lets say my website does events at different places for the same date, and also at different dates:

this makes a structure like this:
Expand|Select|Wrap|Line Numbers

View Replies !   View Related
Using COUNT To Count Multiple Results
having a bit of trouble getting my head around how to set this query up. I've got a tracking script to monitor click-throughs for email campaigns I manage. It enters the users email address, ip, date etc. into a table each time they click off the email to the site.

I've got a query that works just fine to display every click, but what I'd like is for it to just display each email address once, with the number of times they've clicked through next to the address.

Here's the current query: ....

View Replies !   View Related
COUNT WHERE (COUNT > X OR ABOVE) And WHERE DATE -3 Days Before
Example of Date of request 1.

SELECT
Count(tbl_eventbooked.idEvent),
Sum(tbl_eventmain.StartDateEvent)
FROM
tbl_eventmain
Left Join tbl_eventbooked ON tbl_eventbooked.idEvent = tbl_eventmain.id_Event
WHERE
tbl_eventmain.StartDateEvent <= '-2'
GROUP BY
tbl_eventbooked.UserEmail,
tbl_eventbooked.FirstName

Example Count of request 2.

SELECT
Count(tbl_eventbooked.idEvent)
FROM
tbl_eventmain
Left Join tbl_eventbooked ON tbl_eventbooked.idEvent = tbl_eventmain.id_Event
WHERE
Count(tbl_eventbooked.idEvent) >= '15' (but how do you tell it 50% of row X)

View Replies !   View Related
Count(*) As Count And TotalCount Of Count
data in myTable1

(n) country_id
(1) 3
(2) 1
(41) 1
(5) 2
(6) 3
(7) 4

data in myTable4

(time) param
(10 : 10) c=4
(10 : 12) c=2
(10 : 30) n=41&k=5
(10 : 35) c=1
(10 : 37) n=5
(10 : 50) c=2
(10 : 54) c=2
(10 : 55) n=1&cate=6
(11 : 12) c=2
(11 : 15) n=7
(11 : 20) c=1
I have data in myTables like the above.

I have the following code.

code

(select left(time,2) as hour, count(*) as count
from myTable4
where

left(param,1)='c'
and
substring(param,3,1)=2

group by left(time,2)
)
UNION all
(select left(time,2) as hour, count(*) as count
from myTable4,myTable1

where
left(param,1)='n'
and
substring(substring_index(param, '&', 1) ,3)=myTable1.n
and
myTable1.country_id=2
group by left(time,2)
)

order by hour
And the code above produces the following result.

result

(day) count
(10) 3
(10) 1
(11) 1
The following would-be code doesn't work correctly, but it will show what I want.


would-be code

(select left(time,2) as hour, count(*) as count,
sum(count) as totalCount
from myTable4
where

left(param,1)='c'
and
substring(param,3,1)=2

group by left(time,2)
)
UNION all
(select left(time,2) as hour, count(*) as count,
sum(count) as totalCount
from myTable4,myTable1

where
left(param,1)='n'
and
substring(substring_index(param, '&', 1) ,3)=myTable1.n
and
myTable1.country_id=2
group by left(time,2)
)

order by hour
And the following is my target result.

target result

(day) count totalCount
(10) 3 5
(10) 1 5
(11) 1 5


View Replies !   View Related
Add Time :: 2 Hours To Given Time
how I can add a time of 2 hours to a given time (hh:mm:ss)?

View Replies !   View Related
Difference Of Count(*) From Count(1)
Is it true that count(1) is more efficient than count(*)? They say that count(*) still goes through all the records without needing to.

View Replies !   View Related
Select Count Need Even 0 Count
I know I have seen the answer to this on here before (I think). I have a query that does a count and a join. I want to return records that are in one the one table and then their counts of how many times they have been clicked on, even if that count is 0.

Here is what I have:

Code:

SELECT
i.vin
, count( i.vin ) AS clicks
FROM inventory i
RIGHT OUTER JOIN statistics s ON s.vin = i.vin
WHERE
i.active = 1
GROUP BY i.vin
ORDER BY clicks ASC

View Replies !   View Related
Difference Between Count(*) And Count(1)
What is the difference between count(*) and count(1)?

View Replies !   View Related
How To Fix "Column Count Doesn't Match Value Count At Row 1" ?
I've been trying to install a portal to my installation of Invision Power Board, and I keep coming up with this problem. I post here for two reasons: firstly is that no one is responding over at the portal creator's thread and I need help, second is that this error looks like a mySQL error that could be solved without the need of the creator if possible.

Here is the error returned:

mySQL query error: INSERT INTO `ibf_portal_box` VALUES (1, 'lang.last_topics', '<box><menu>10,20,30,50</menu>
<topics_show>10</topics_show>
<order>last_post</order>
<exforums></exforums>
</box>', 0, 'middle', '*', 0, 4, 'last_topics', '1')

mySQL error: Column count doesn't match value count at row 1
mySQL error code:
Date: Tuesday 21st of December 2004 08:43:10 PM

I am very new to mySQL and don't really understand it. What is wrong with the above that it is trying to insert, and how is it fixed?

View Replies !   View Related
Count(*) In A Select Returns "1". It Should Behave Like Select Count(*)
i'm trying to make a query work properly but I got lost:

SELECT *,count(*)
FROM cancons c, musics m, discos d, r_discos_cancons rdc
WHERE c.c_id_music = m.m_id
AND rdc.rdc_id_disc = d.d_id
AND d.d_id_music = m.m_id
AND m.m_id = 24
GROUP BY c_id

note:
cancons (ca) = songs (en)
discos (ca) = cd's (en)
music (ca) = musician (en)

don't worry for the WHERE part. i need it because of the foreign keys.
this query returns a table with the title of the song and some more data. on the right side, I get another column called "count(c_id)" with the number "1" in it for each row. That's supposed to be due to the "group by" clause, I think.

I'd like to get the table with the songs, as usual, and, with the same query, I'd like to get the total number of rows selected.

View Replies !   View Related
Date Field, Time Field, Sort By Date And Time
I have a MySQL date field (e.g 13/12/2006) and a MySQL time field (e.g.13:00) in the same row.

I'd like to join these two fields to make a date/time field (e.g. 13:00 13/12/2006) on the fly and to be able to sort the query results on the resulting field.



View Replies !   View Related
4.1.1 And 5.0.0 At The Same Time ?
mysql-4.1.1-alpha-win.zip

mysql-5.0.0-alpha-win.zip

Is it possible to install and run both MySQL versions under windows 2000? On one computer.

I don't intend to run them at the same time, but investigate the new features.

I'd like to install them in different directories and select the one that suits my needs.

View Replies !   View Related
SUM Time
I have managed to write the following query, which works well with the sum for the TOTAL values, but the values I get for Queue1, Queue2, Queue3, Queue4 all give me the wrong totals. Where am I actually going wrong?

The values within the table has been set as TIME with a default of 00:00:00.

the following is my query....

View Replies !   View Related
Set DB Time
Hello! I have a easy question; how do you set the time on mysql v4.1?

View Replies !   View Related
Add Time In One Row
i have a query:

SELECT
`date`,
Last_Name,
Time_Start,
Time_End,
subtime(time_end,time_start) as 'time due'

FROM
coding_adjustments

order by
`date` DESC,
Last_Name
=============
and i have to add 'time due' with the same date and last_name in time format.

View Replies !   View Related
Time In SQL
i have a table that has many categories... I want to reset one of the columns to zero at 12:00am every friday automatically. How do I do that?
Second, i have a column thats auto_increment... lets say i set the first value to 10... if i add one more row... then the next row will be 11... how do i reset it to start with 0?

View Replies !   View Related
Time Out, ASP
I don't know if it's inefficient vbscripting, a slow server, a badly organised database or some other reason, but...

Relatively simple scripts on our unix server keep timing out, and this is even after beefing up the time out to 120 seconds! The scripts don't seem to be doing much, although whenever one or more tables are referenced, the server takes ages and times out.

My method of querying is:

-check form data
-create a connection
-compose a sql string
-execute it to make a record set
-cycle thru the record set and copy data to arrays
-close the record set (+ set to nothing)
-close the connection (+ set to nothing)
-do the html, with data from the arrays, etc.


I used to open record sets separately, rather than on a connection, and also used to keep the record set open and cycle through it in the HTML rather than use arrays.

View Replies !   View Related
Time In My Sql
i want to retreive the time in GMT and store it in a DATETIME variable, for example the function now() retrieve the local time but i want to retrieve the time in GMT...

View Replies !   View Related
Now() + More Time?
How can I insert a timestamp into a database which is equal to the current time plus (for instance) and hour and 36 seconds?

The code below is a complete shot in the dark:

insert into TABLE values ('','now()+1hour 36seconds')



View Replies !   View Related
Time
in php my admin, i need to create a Time colum for a table but i only need the hh:mm part to be saved. so how do i ask the mysql to save only hh:mm with out seconds.

View Replies !   View Related
Time ADD
00:19:56
00:25:22
01:33:12 .........

View Replies !   View Related
Two Queries At The Same Time?
I have 2 queries:

The {..} are precalculated values. At the beginning no item can be
matched by both where clauses.

1)
update tabelle
set L = L + {MOVE}
set R = R + {MOVE}
where L >= {LEFT} and R <= {RIGHT}

2)
update tabelle
set L = L - {DIFF}
set R = R - {DIFF}
where L >= {OTHERLEFT} and R <= {OTHERRIGHT}

My problem: If I run update 1 first, the update 2 can match items from
where clause 1 because the update changed the values from L and R so that
they can be found at where clause 2.

And if I run 2 first its the same in the other direction.

So how can I do the 2 where clauses first, and when mysql knows my items I
would like to update so no item gets updatet twice.

View Replies !   View Related
Time Series
I just wondering if there is a recommend table design for dealing with
time series data?

View Replies !   View Related
Time + XX Minutes
can someone explain me the advantage of using date and time, and also can i set time + XX minutes??

View Replies !   View Related
Update Time
I have a table with 4 different columns to record IP address of people visiting my site. If a new IP comes it is recorded and a time also written on the last column.

when an exisiting IP comes again. The time becomes "0000-00-00".

Here is the code after you already connect with the database and an IP is found on the database or not.

Note: $Username_Found is a variable == 1 when an IP address is already found on the database. Default is not found == 0......

View Replies !   View Related
Time With Milliseconds
want hr:min:sec:millisecs.

DATETIME is the correct type and what should go inside the parantheses.

If i am doing a:

CREATE TABLE startTable

(TIMESTAMP DATETIME()

View Replies !   View Related
After Date And After Time
I would like to make a memo script that once you have entered the date and time and note in a memo intto the database the memo is displayed once both date and time have passed. I dont want the memo to disappear until it is told to. I have an idea how to make it disappear, but I dont know what the syntax is for the sql for AFTER the date has passsed and AFTER the time has passed.

View Replies !   View Related
Aggregate Time Sum
I have many "track length" fields in a table, I wish to have these all added up and produced as a field... Much like "SELECT SUM(`x`) FROM `table` WHERE 1"

I see there is an ADDTIME but... This adds one value to another, I just wish to add all the fields together

View Replies !   View Related
Central Time
I am working on a tagwall and I want central time, but somehow I am getting Danish time from my website and they are 7 hours in front of me!

query = "insert into tagwall set
ip='$ip',time=now(), name='$name', email='$email', message='$message'";

mysql_query($query);

}
$result = mysql_query("select name, email, message, date_format(time, '%H:%i, %c/%e/%Y') as thetime from tagwall order by time desc");

View Replies !   View Related
Control Max Time
Does anyone know of any parameters that can be set to control the maximum time limit mysql will allow a single query to run before timing out etc?
Rather than let badly written queries run for long periods I would like to just abort them if they exceed a set amount of time.
I know the php calling script should/could handle this with defensive coding etc. However, I'm not always in control of how other users write their scripts that interact with mysql.

View Replies !   View Related
Dealing With Time
I have a database that I have written the time in to (format hh:mm:ss) TIME field MySQL. I also have a DATE field.

I'd like to check and see if the entry is more than 2 hours old, and if so, send an email message. Is there an easy way to compare the current time to the entry and determine if it is more than 120 minutes old?

View Replies !   View Related
INSERT At A Time
i'm setting up a local db between 2 machines,
using php/mysql, and 2 users will be logged in at the same time.
my concern is duplicating entries into the db.
per INSERT, i generate an id number, which is actually the
date and time, ie. 12321620041103

since its only the date and time,
if the 2 users logged in happen to do an INSERT at the same time,
will mysql only process one insert at a time, or will both
go thru at once?i dont want them to go thru at the same time, because they
will both have the same id number.

View Replies !   View Related
Grouping By Time
query = "SELECT DATE, TIME, TOTU WHERE DATE >= '2009-02-08' GROUP BY DATE, TIME";

I get several days... but for simplicity, yesterday '2009-02-08' I got an output as:

DATE TIME TOTU
2009-02-08 00:30:00 453
2009-02-08 01:00:00 296
2009-02-08 01:30:00 218
2009-02-08 02:00:00 171
2009-02-08 02:30:00 121
2009-02-08 03:00:00 86
2009-02-08 03:30:00 98
2009-02-08 04:00:00 116
2009-02-08 04:30:00 82
2009-02-08 05:00:00 62
2009-02-08 05:30:00 64
2009-02-08 06:00:00 88
2009-02-08 06:30:00 162
2009-02-08 07:00:00 274
2009-02-08 07:30:00 486
2009-02-08 08:00:00 734
2009-02-08 08:30:00 995
2009-02-08 09:00:00 1179
2009-02-08 09:30:00 1319
2009-02-08 10:00:00 1432
2009-02-08 10:30:00 1721
2009-02-08 11:00:00 1576
2009-02-08 11:30:00 1526
2009-02-08 12:00:00 1503
2009-02-08 12:30:00 1561
2009-02-08 13:00:00 1442
2009-02-08 13:30:00 1542
2009-02-08 14:00:00 1440
2009-02-08 14:30:00 1327
2009-02-08 15:00:00 1445
2009-02-08 15:30:00 1307
2009-02-08 16:00:00 1355
2009-02-08 16:30:00 1251
2009-02-08 17:00:00 1344
2009-02-08 17:30:00 1487
2009-02-08 18:00:00 1683
2009-02-08 18:30:00 1921
2009-02-08 19:00:00 2074
2009-02-08 19:30:00 1993
2009-02-08 20:00:00 2025
2009-02-08 20:30:00 2036
2009-02-08 21:00:00 1944
2009-02-08 21:30:00 1620
2009-02-08 22:00:00 1170
2009-02-08 22:30:00 952
2009-02-08 23:00:00 655
2009-02-08 23:30:00 419
2009-02-08 24:00:00 271..............

View Replies !   View Related
Local Time
I'm not if this belongs here or in PHP.
I run this query
Code:
"SELECT id AS ID, rain AS Rainfall, f_name AS Firstname, l_name AS Lastname, property AS Property, town AS Town, date AS DATE FROM $table ORDER BY date DESC, rain";
Data is added by a form, and the default value I put for time is NOW
I'm downunder, and, I want today's date displayed ( today as we know it), not a date from the other side of the planet.
I found SET Time ZONE EST - but I wasn't sure where to use it - or if that was really what I needed.

View Replies !   View Related
Time Tracking
I am having a hard time tracking to when it started. But basically in IE when I attempt to load a script for what it seems like the first time per session I get a login prompt open like what i see when I login in to MySQL, this script uses MySQL heavily.

View Replies !   View Related
Query Time
Is there a function out there to determine the length of time a particular query took

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved