Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 romping around the Monastery: (6)
As of 2014-09-24 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (243 votes), past polls