Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Generate a date stamp of today less a date interval

by TedPride (Priest)
on Dec 20, 2005 at 09:58 UTC ( #518002=note: print w/ replies, xml ) Need Help??


in reply to Generate a date stamp of today less a date interval

How about:
SELECT SUBDATE(datefieldname, INTERVAL 13 MONTH);

You can then format the result as needed with DATE_FORMAT(). I'm willing to bet both processes will be more efficient done through database than Perl.

EDIT: Oops - as pointed out by grinder in PM, he already specified that the database approach wouldn't work, since the field is TEXT. Somehow I missed that. Whoever designed the table needs some serious punishment.


Comment on Re: Generate a date stamp of today less a date interval
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://518002]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2015-07-30 05:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls