Re: How to add date/time to reports?

2002-03-08 Thread Son Nguyen


--- Jarkko Toivonen <[EMAIL PROTECTED]> wrote:
> I was just wondering that how to add date/time to every report run in
> MySql. 
> I've got a database that contains everything about my home-made
> beers. I run 
> a select-query sometimes and I want to include the time when it was
> run in 
> it.
> 
> So, any ideas?

If you want to have an update date stamp in the row in a table => try
to have a datetime update field (update that field every time you
update the row)

If you want to have an date stamp when somebody update a table ==>
create a different table with two fields: 1 is the name of the table,
which you intend to keep the date stamp, the other field is the
datetime update field.  Update the new table associate with the table
name ... ;-)

  I don't know whether mySQL has a function to specify when is the last
update on a certain table or not.

> 
> Thanks!
> 
> _
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
> -
> Before posting, please check:
>http://www.mysql.com/manual.php   (the manual)
>http://lists.mysql.com/   (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try:
> http://lists.mysql.com/php/unsubscribe.php
> 


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: How to add date/time to reports?

2002-03-08 Thread Roger Baklund

* Jarkko Toivonen
> I was just wondering that how to add date/time to every report
> run in MySql.
> I've got a database that contains everything about my home-made
> beers. I run
> a select-query sometimes and I want to include the time when it
> was run in it.

Add "now() as report_time" to your field list:

  SELECT *,now() as report_time FROM table WHERE field='A';

The timestamp will be available as a field named 'report_time'. Put this in
the header (or footer) of your report.

--
Roger
query


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php