Results 1 to 2 of 2

Thread: Need help with a SQL statement

  1. #1
    chrislynch8's Avatar
    chrislynch8 is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Cork, Ireland
    Posts
    747

    Default Need help with a SQL statement

    Hi,

    THis is want I want to acheive - I want to search on a date field where all values are more then 1 day ago and to then update all those value by one year.

    How do I use a SQL select to select all the correct date I need?

    Rgds
    Chris
    Linkedin Profile:Chris Lynch

    FDC IT Solutions
    FDC House
    Wellington Road
    Cork
    Ireland

  2. #2
    davidboris is offline Sugar Community Member
    Join Date
    May 2010
    Posts
    1,113

    Default Re: Need help with a SQL statement

    Hello,

    Something like,

    UPDATE tablename SET field_name = DATE_ADD(field_name,INTERVAL 1 YEAR) WHERE field_name < CURDATE();
    Thumbs up.

    Skype ID - david__boris

    SugarForge Projects:

    WYSIWYG now in studio!(Version 1.1 is out now!)

    Sugar Feeds on your personalized home pages like iGoogle, My Yahoo!, etc.

    Fab Tools! > Dashlet Not Followed Opportunities for past six Months

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2010-04-16, 12:39 PM
  2. Help with a SQL statement
    By Iggby in forum Developer Help
    Replies: 2
    Last Post: 2009-03-31, 03:24 PM
  3. Need help in sql statement for meeting module
    By jgyc430 in forum Developer Help
    Replies: 1
    Last Post: 2009-02-12, 12:35 AM
  4. Join or IF Statement??
    By gkeyes in forum Help
    Replies: 3
    Last Post: 2008-05-22, 05:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •