Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Unmatched Records...

Status
Not open for further replies.

roystreet

Programmer
Oct 12, 2000
146
US
Hello, I've tried to find the answer to this question, but I've haven't been able to find it yet. I have two obejects:
tbl_ItemDetails
qry_MeetingSummary_ForReports

First one holds items that are associated with the meetings listed in the meeting summary query. Just in case a meeting gets deleted out of the system, but the items don't get deleted or moved to another meeting, I would like to be able to check for the items that don't have a matching meeting date. Then, I would like to update the items date to "-xx No Date xx-" I have a special No Date 'Box' that these items sit in until the user will place them in the appropriate meeting date. The common field is MeetingDateString. Currently, I have purposed to have a couple of items without a date entirely so they are Null and then I have one item that has a date that doesn't match any of the meeting dates. So far, none of those items are showing up in this table - So nothing is going to get updated. This is the SQL I'm using:
Code:
UPDATE tbl_ItemDetails INNER JOIN qry_MeetingSummary_ForReports ON tbl_ItemDetails.MeetingDateString = qry_MeetingSummary_ForReports.MeetingDateString SET tbl_ItemDetails.MeetingDateString = "-xx No Date xx-"
WHERE (((tbl_ItemDetails.MeetingDateString) Is Null));

I appreciate any help!
---roystreet
 
I think you want
Code:
UPDATE tbl_ItemDetails D 
SET D.MeetingDateString = "-xx No Date xx-"

WHERE NOT EXISTS 
(Select * From qry_MeetingSummary_ForReports M
 WHERE M.MeetingDateString = D.MeetingDateString)
 
Golom...
Thank you very much, that worked great!! I'm still working on learning SQL more.

Have A Good Day,
---roystreet
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top