Ok, you said you were using a scripting language, what is it, PHP?
If it is the case, I suggest you drop the last column 'DaysLeft' and make a
function in the scripting language of your choice that takes the 'PostStart' and
'LenChoice' as arguments:
in PHP it would write like this: (hope you un
No, but it will tell you how to compute the field or, maybe, change your design!
You definitely need an update statement, something like:
update set DaysLeft=wathever your figure out from your reading.
Now how to run this automatically? Well I do not know if you are
using MS WIndows or Linux.
You can't automatically update it, that would require triggers which are
not supported in mysql, you would need some sort of script that runs
once a day and manually uses the functions described in the linke
Bernard sent you to update the field.
However I would recommend a different table structur
--- Bernard Clement <[EMAIL PROTECTED]>
wrote:
>
> You will get your answers by reading carefully the
> Date Time Functions
> in the MySQL Reference Manual.
>
This will tell me how to automatically update the
column in question ?
Stuart
--
MySQL General Mailing List
For list archives: http
You will get your answers by reading carefully the Date Time Functions
in the MySQL Reference Manual.
Look at the URL: http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html
Bernard
On Wednesday 17 November 2004 16:40, Stuart Felenstein wrote:
> While I'm figuring this needs to be addre
While I'm figuring this needs to be addressed via my
scripting language wanted to ask here.
Customers will buy a block of time to use my service.
Time meaning "number of days". 90, 45, 60, etc.
Here are the fields relevant to this question:
PostStart [Date]
LenChoice [int]
DaysLeft [int]
Wh
Hi All
I've not been able to find a good answer to this or figure out what
would be the best approach - bear in mind I am a beginner.
I have tried the following
> USE databas
> SELECT Item_A AS 'Something 1',
> Item_B AS 'Something 2',
> Item_C AS 'Something 3',
> INTERVAL 6 MONTH + Item_B AS 'So
arrgg, sorry i made a mistake and my precedent mail
was sent before i finished wrting it :-{,
the query is:
INSERT INTO `TBL_COUNT_EXCLUDE`
SELECT MAIN.id, SUM(IF(EX.excl_date BETWEEN
MAIN.start_date AND MAIN.end_date, 1, 0)) AS
excl_count
FROM TBL_MAIN_DATE AS MAIN, TBL_EXCLUDE_DATE AS EX
GROUP
hi all,
i've a question concerning the calculation of the
number of days between 2 dates, and after searching
the mailing list i'm still stuck, any help will be
appreceiated :}
actually i've a table with a lot of rows (varying
between 5 to 15 millions), each row has a unique id
and 2 date:
start_
On 8 Aug 2003 at 10:16, Oswaldo Castro wrote:
> I have two datetime fields on my database. I nedd to return the
> difference in minutes between them. I tried date_sub,
> extract(hour_minute from ...) and it does't work
SELECT ( UNIX_TIMESTAMP(datetime2) - UNIX_TIMESTAMP(datetime1) ) /
60;
(assu
Hi List
I have two datetime fields on my database. I nedd to return the difference
in minutes between them. I tried date_sub, extract(hour_minute from ...) and
it does't work
Any help will be very apreciated.
Thanks
Oswaldo Castro
--
MySQL General Mailing List
For list archives: http://lists
On 29 Nov 2001, [EMAIL PROTECTED] wrote:
> I need to calculate the difference in seconds for two registers type
> datetime, My question is if exists some function or trick on mysql for
> perform it? I need this for calculate some information about time for
> a billing system so I need precision of
Dear Sirs:
Please I am facing the follow problem:
I need to calculate the difference in seconds for two registers type datetime, My
question is if exists some function or trick on mysql for perform it? I need this for
calculate some information about time for a billing system so I need precis
13 matches
Mail list logo