×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Iterate results update records

Iterate results update records

Iterate results update records

(OP)
Hi Guys can you help with coming up with a query.
I update this table daily by crawling a website each day with vehicle details .
What i need is if a registraion is missing for a day I want to update VehicleSOLDDate with the latest datetime for that missing registraion ?

using SQL server 2012

registraion | Datetime |VehicleSOLDDate
abc def |01/01/2017 00:00 |
aaa bbb |01/01/2017 00:00|
abc def |02/01/2017 00:00|
aaa bbb |02/01/2017 00:00|
abc def |03/01/2017 00:00 | 03/01/2017
aaa bbb |03/01/2017 00:00|
aaa bbb |04/01/2017 00:00 |

RE: Iterate results update records

You need to keep a copy of the previous day's query. Then use a MINUS or NOT IN query to find all records that are in yesterday's data, but not in today's.

==================================
advanced cognitive capabilities and other marketing buzzwords explained with sarcastic simplicity


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close