how to make day in mysql or java

Problem :

SELECT TIMESTAMPDIFF(day, '2012-06-04 13:13:55', '2012-06-05 15:20:18')

i want totals

day 2
but mysql show 1 day

Solution :

Actually the difference between them is 1 days 2 hours 6 minutes 23 seconds which is obviously not 2 days so if you want 2 days to be the result just add 1 to the result obtained.

 SELECT TIMESTAMPDIFF(DAY, '2012-06-04 13:13:55', '2012-06-05 15:20:18')+1;

Mysql Tutorials

Mysql Howto..

how to get records from field having contain field ids like (1,2,3) in a field in mysql?

Python, How to take a comma separated sys argv, and make it like '1','2' (for MySQL “IN” Query)

how to merge a query result by datetime in same table mysql?

How to get Phusion Passenger, MySQL and Rails to play nicely in production

how to match in mysql

How to identify if the submitted value came from the autocomplete script?

How to easy upload content to MySql database in Java using JDBC? [closed]

How can I use PHPUnit to set up and tear down the database using a SQL file?

How to use delete cascade on MySQL MyISAM storage engine?

How to get data form mysql database using php date?

how to make a fixed-number-of-words-search dynamic in Coldfusion/MySql?

How to do performance tuning for huge MySQL table?

How do i know how much space i need for mysql database

How do I cast a type to a bigint in MySQL?

How do I select a value whose id don't exist as parent to others, in mysql?

How to save mysql search result in variable

PHP - How to check URLS for 404/Timeout?

How to optimise MySQL queries based on EXPLAIN plan

how to select only one value from more similiar values using mysql order by

How to find number of rows affected by INSERT INTO statement in ColdFusion And MySql Database?

how to remove leading and trailing slash in mysql

How to Insert custom date into mysql timestamp field?

How to get MySQL value from certain row?

MYSQL: two joins on same table become double grouped count. How to fix it?

Mysql how to return a test on children in one-to-many relationship

How to determine if MySQL UPDATE actually matched any rows with WHERE clause?

How to update column with system date using mysql and php

How to generate invoice number with special requirement using PHP or MySql

How to know how many mysql lines updated

How to query Mysql multiple tables