Re: SQL NEWBEE QUESTION



Thanks for the help! To answer your question, yes, the code NOW does update
the History table when the main record is deleted. I needed a routine to go
back into all the thousands of history records that were created incorrectly
before.

Thanks again!!

"Marc Rohloff" <marcrohloff_ng@xxxxxxxxxxx> wrote in message
news:1161959275.930303.238790@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Richard Wakeman wrote:
What I need to have happen is to have a quick way (SQL) to go thru the
History table, and replace some data into a History Table Field based
upon
whether that History records's counter part in the Main Table has been
deleted (not there anymore). We still want to keep History Records of
those
deleted in the Main. Am I making any sense?
Shouldn't you rather have your code update the history table when the
main record is deleted?

Anyway, the SQL code for it would be something like:
UPDATE HISTORY.DBF SET HDUPNUM = "1" INNER JOIN MAIN ------- and here I
get lost....

Normally it is something like:
UPDATE HISTORY SET HDUPNUM="1"
WHERE HISTORY.KEY NOT IN (SELECT MAIN.KEY FROM MAIN)

--
Marc



.



Relevant Pages

  • Re: Another Days, Hours, Minutes, Question
    ... I need a routine for computing a time period -- using a historical date ... I've read messages concerning issues when calculating time over days when ... Just looking for a better routine.. ... for history and other tasks. ...
    (microsoft.public.excel.programming)
  • Re: Yankees at a Crossroads?
    ... history was changed forever. ... I am beginning to wonder if the Yankees, ... and history will answer these questions. ... He'd relied on his own routine. ...
    (alt.sports.baseball.ny-yankees)
  • Re: Yankees at a Crossroads?
    ... history was changed forever. ... I am beginning to wonder if the Yankees, ... and history will answer these questions. ... Wang also said he did the same routine that he'd ...
    (alt.sports.baseball.ny-yankees)
  • Re: Favorite Richard Pryor Moment
    ... The greatest moment in Richard Pryor's history was his stand-up ... > routine on Saturday Night Live where he was so stoned that he forgot ...
    (rec.sport.pro-wrestling)
  • Re: Numbers in words
    ... Thank for the nice words Chuck, ... By way of history, I developed that routine for the compiled version of Visual Basic, but the code is reasonably "clean" and it required no tweaking at all to bring it into the VBA world. ... Rick ...
    (microsoft.public.excel.worksheet.functions)