Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 cooling their heels in the Monastery: (14)
As of 2014-07-10 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (209 votes), past polls