Hi,
> How do I set up a field called Minutes which has the (default) value, where
>
> round((SessionTime+30)/60) = Minutes
>
> Is it possible to set this up? In other databases (Alpha Five) I would have
> used a Calculated Field attribute to achieve this.
>
> Can MySql handle it.. ???????
In SQL databases in general, there is no such thing as a 'Calculated' field
type. What you're probably used to is just a convinience supplied by other
database systems.
What you need to do to accomplish what you want is to calculate that minutes
value on the fly, within the SELECT statement that retrieves your data. You
don't need to add any fields to your table to do this.
Here's an example:
SELECT ROUND((SessionTime + 30) / 60) AS Minutes FROM YourTable
Regards,
------------------------------------------------
Basil Hussain ([EMAIL PROTECTED])
---------------------------------------------------------------------
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