Re: possible query #2

2003-07-03 Thread Victoria Reznichenko
Fabrizio Tivano [EMAIL PROTECTED] wrote:
 
 on MySQL 3.23.54
 i have a table that list the number of  user-time days like:  35 
 
 whellbased on curdate() function 
 
 can i able to make a select wich display  the sum (150-35)
 where 150 is date_format(curdate(), '%j')
 in a format like (%d/%m/%y) ?
 
 this kind of query is possible? 
 ...if yes how?

Sorry, but your explanation is not clear enough for me. You can't apply arithmetic 
operation directly on DATE columns, take a look at TO_DAYS() and FROM_DAYS() functions:
http://www.mysql.com/doc/en/Date_and_time_functions.html


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



possible query #2

2003-07-02 Thread Fabrizio Tivano

Hello dear all,

on MySQL 3.23.54
i have a table that list the number of  user-time days like:  35 

whellbased on curdate() function 

can i able to make a select wich display  the sum (150-35)
where 150 is date_format(curdate(), '%j')
in a format like (%d/%m/%y) ?

this kind of query is possible? 
...if yes how?

...or there is only a madness? :)

thanks in advance, 
fabrizio

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



possible query?

2003-06-10 Thread Fabrizio Tivano

hello dear all, 

i need to make a select on mysql with IF funcion:

if ('stop' 'start', stop, '+++')

where start and stop are timestamps.
and [+++] is an error char.


Actually my select result are:


+--++
| data | start | stop   |
+--+---++
| 20030301 | 74621 |+++ |
| 20030302 | 74840 | 181211 |


but i have a question:

Is possible, and if yes how, 
to make so that query generate a result like:


+--++
| data | start | stop   |
+--+---++
| 20030301 | 74621 |0020 +++ |
| 20030302 | 74840 | 181211 |

where: if the stop time is  (less than) start time
i can print stop time and error char together.



Thanks in advance !

fabrizio

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: possible query?

2003-06-10 Thread rich johnson
Hi,

if (stop  start, stop, CONCAT(stop, '+++'))

should do the trick.

- Rich

hello dear all,

i need to make a select on mysql with IF funcion:

if ('stop' 'start', stop, '+++')

where start and stop are timestamps.
and [+++] is an error char.
Actually my select result are:

+--++
| data | start | stop   |
+--+---++
| 20030301 | 74621 |+++ |
| 20030302 | 74840 | 181211 |
but i have a question:

Is possible, and if yes how,
to make so that query generate a result like:
+--++
| data | start | stop   |
+--+---++
| 20030301 | 74621 |0020 +++ |
| 20030302 | 74840 | 181211 |
where: if the stop time is  (less than) start time
i can print stop time and error char together.


Thanks in advance !

fabrizio

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: possible query?

2003-06-10 Thread Mikhail Entaltsev
Try to use 'concat()' function.

if ('stop' 'start', stop, concat(stop,'+++'))

Best regards, 
Mikhail.

- Original Message - 
From: Fabrizio Tivano [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 10, 2003 13:07
Subject: possible query?


 
 hello dear all, 
 
 i need to make a select on mysql with IF funcion:
 
 if ('stop' 'start', stop, '+++')
 
 where start and stop are timestamps.
 and [+++] is an error char.
 
 
 Actually my select result are:
 
 
 +--++
 | data | start | stop   |
 +--+---++
 | 20030301 | 74621 |+++ |
 | 20030302 | 74840 | 181211 |
 
 
 but i have a question:
 
 Is possible, and if yes how, 
 to make so that query generate a result like:
 
 
 +--++
 | data | start | stop   |
 +--+---++
 | 20030301 | 74621 |0020 +++ |
 | 20030302 | 74840 | 181211 |
 
 where: if the stop time is  (less than) start time
 i can print stop time and error char together.
 
 
 
 Thanks in advance !
 
 fabrizio
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: possible query?

2003-06-10 Thread Fabrizio Tivano

Mikhail, Rich:

it work! 
thanks again 

fabrizio

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]