JoeP
03-31-2003, 09:18 PM
I would appreciate a tip on looping through A MS Access Table with an "UPDATE" query to check the following condition:
If Today's Date Is 30 Or More Days Than Date3.
If True Then:
I would like to shift Dates & Values. Set Date2 & 3 + Int Fields to "" & 0 Respectively.
Update Date1 To Date2
Update Field2 To Field5
Update Field3 To Field6
Update Date2 & Date3 = ""
Update Fields5-6 8-9 = 0
[Field1]Date1
[Field2]Int1
[Field3]Int1
[Field4]Date2
[Field5]Int2
[Field6]Int2
[Field7]Date3
[Field8]Int3
[Field9]Int3
Could someone modify this SQL statement the most efficient way:
SQLstmtQA = "UPDATE [History]"
SQLstmtQA = SQLstmtQA & " Set [Field7]="",[Field8]=0,[Field9]=0"
SQLstmtQA = SQLstmtQA & " WHERE [?]
Set rsQA = connQA.execute(SQLstmtQA)
TIA For ANY Suggestions or Tips.
If Today's Date Is 30 Or More Days Than Date3.
If True Then:
I would like to shift Dates & Values. Set Date2 & 3 + Int Fields to "" & 0 Respectively.
Update Date1 To Date2
Update Field2 To Field5
Update Field3 To Field6
Update Date2 & Date3 = ""
Update Fields5-6 8-9 = 0
[Field1]Date1
[Field2]Int1
[Field3]Int1
[Field4]Date2
[Field5]Int2
[Field6]Int2
[Field7]Date3
[Field8]Int3
[Field9]Int3
Could someone modify this SQL statement the most efficient way:
SQLstmtQA = "UPDATE [History]"
SQLstmtQA = SQLstmtQA & " Set [Field7]="",[Field8]=0,[Field9]=0"
SQLstmtQA = SQLstmtQA & " WHERE [?]
Set rsQA = connQA.execute(SQLstmtQA)
TIA For ANY Suggestions or Tips.