Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    updating date based on search results

    What's the best way to do this? I need to search an invoice table. For a specific company name, I need to update all invoice dates to match their shipping dates. In other words, I need to search for a company name, and for each match update the invoice date to be the shipping date.

  • #2
    Regular Coder devinemke's Avatar
    Join Date
    Dec 2004
    Location
    NYC
    Posts
    443
    Thanks
    0
    Thanked 12 Times in 11 Posts
    Code:
    UPDATE invoices SET invoice_date = shipping_date WHERE company_name = 'XYZ'
    Last edited by devinemke; 08-17-2006 at 07:24 PM.

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    devinemke, when seeing this type of question please try to see what the user has attempted and see if you can steer them to the answer. This looks quite familiar as a homework type of question. As a general rule we don't want these type of questions answered without input from the original poster.

    bryan11 if it is a homework question please read the Rules and Posting Guidelines for future posting information.

    Thanks,
    Dave

  • #4
    New to the CF scene
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have a good point, guelphdad, but this just a minor fire fighting task, not homework. I've just been thrown into a project with PHP and MySQL where I'm not that familiar with either yet. Using Google with "MySQL update date based on results" to find an answer wasn't working well.

  • #5
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,633
    Thanks
    4
    Thanked 148 Times in 139 Posts
    No problem bryan, it is just a common occurance on this and other discussion boards so I'd thought I'd point it out to our users who can learn from it in the future.


  •  

    Posting Permissions

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