Mike,

Sure, try this:

UPDATE table SET days = TO_DAYS(exp_dte) - TO_DAYS(NOW());"

As a side note, I recommend you make this calculation in whatever application this DB supports. Otherwise you will continue to need running a script to update the dates.

Regards,
A$

On Saturday, August 2, 2003, at 06:07 PM, Mike Blezien wrote:

Hello,

I need to update one of our mysql tables, which has about 60,000 entires and correct the amount of days remain on each data record. An example of one of the data entires is:
memid days regdate expdate
--------------------------------------
625290 | 5 | 2003-07-15 | 2003-08-16


now the days should be 14 and not 5 days. I have been trying to update the table with a single SQL query but haven't come up with a way to do this.. I'm sure it's something simple but I can't seem to come up with it. What is the best way to accomplish this in a single query to update the entire table so all the "days" are accurate according to the "expdate", and change the "days" so they are correct ??

thx's
--
Mike<mickalo>Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Web Hosting
http://www.justlightening.net
Tel:  1(985)902-8484
MSN: [EMAIL PROTECTED]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
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]



Reply via email to