G
Guest
I need to update table [MERGE] from table [REPORT_CODE]. The following fails,
but I don't know why. Please note that some of the hi/lo ranges overlap, so I
need the query to update the first one it finds.
What is the best way to accomplish what I'm trying to do?
Would it be better to loop thru a recordset?
Can someone please show me how to improve this SQL?
UPDATE [MERGE]
SET [MERGE].[RPT_CODE] = [REPORT_CODE].[RPT_CODE]
WHERE
(([MERGE].[FUND] >= [REPORT_CODE].[FUND_LO] AND
[MERGE].[FUND] <= [REPORT_CODE].[FUND_HI]) AND
([MERGE].[ACCOUNT] >= [REPORT_CODE].[ACCT_LO] AND
[MERGE].[ACCOUNT] <= [REPORT_CODE].[ACCT_HI]) AND
([MERGE].[FERC] >= [REPORT_CODE].[FERC_LO] AND
[MERGE].[FERC] <= [REPORT_CODE].[FERC_HI]));
Thanks in advance for your kind and gentle assistance.
but I don't know why. Please note that some of the hi/lo ranges overlap, so I
need the query to update the first one it finds.
What is the best way to accomplish what I'm trying to do?
Would it be better to loop thru a recordset?
Can someone please show me how to improve this SQL?
UPDATE [MERGE]
SET [MERGE].[RPT_CODE] = [REPORT_CODE].[RPT_CODE]
WHERE
(([MERGE].[FUND] >= [REPORT_CODE].[FUND_LO] AND
[MERGE].[FUND] <= [REPORT_CODE].[FUND_HI]) AND
([MERGE].[ACCOUNT] >= [REPORT_CODE].[ACCT_LO] AND
[MERGE].[ACCOUNT] <= [REPORT_CODE].[ACCT_HI]) AND
([MERGE].[FERC] >= [REPORT_CODE].[FERC_LO] AND
[MERGE].[FERC] <= [REPORT_CODE].[FERC_HI]));
Thanks in advance for your kind and gentle assistance.