Re: Question on date calculation +

2004-11-17 Thread Simon
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

Re: Question on date calculation +

2004-11-17 Thread Bernard Clement
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.

Re: Question on date calculation +

2004-11-17 Thread John McCaskey
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

Re: Question on date calculation +

2004-11-17 Thread Stuart Felenstein
--- 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

Re: Question on date calculation +

2004-11-17 Thread Bernard Clement
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

Question on date calculation +

2004-11-17 Thread Stuart Felenstein
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

Date calculation and displaying the right date

2004-05-06 Thread Thomas Nyman
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

date calculation, design advice needed (continued)

2003-09-12 Thread Chambers John
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

date calculation, design advice needed

2003-09-12 Thread Chambers John
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_

Re: Date Calculation

2003-08-14 Thread Keith C. Ivey
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

Date Calculation

2003-08-09 Thread Oswaldo Castro
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

Re: date calculation

2001-11-29 Thread jaab
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

date calculation

2001-11-29 Thread correo
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