|
-
Sep 26th, 2000, 01:52 AM
#1
Thread Starter
Lively Member
Hi all,
I have a table with 7 fields, 2 of which contain $ values. I want to delete all records, where both fields containing dollar values = $0.00. I am using ADO in VB6. Can anyone help me or supply me with some sample code that will do this?
I thought it might invlove a query...
Delete * from ... Where .... And .... =$0.00
but am unsure how to do this.
Cheers
-
Sep 26th, 2000, 01:55 AM
#2
Junior Member
hi, use such sql statement:
delete from TableName where 1stFieldName = 0 and 2ndFieldName=0
Best wishes,
Syl
-
Sep 26th, 2000, 07:10 AM
#3
Thread Starter
Lively Member
I am trying to use the following code to delete records from a table using ADO.
With DataEnvironment1
Delete From .rscmdTemp WHERE .rscmdTemp!Sell = "0" AND .rscmdTemp!Breakeven = "0"
End With
I'm getting the error message, "Compile Error: Expected End of Statment"
Can any body help?
-
Sep 26th, 2000, 07:18 AM
#4
Junior Member
perhaps that can help, but it's necessary to have active connection set:
Code:
sub DeleteRecords
dim rst as new adodb.recordset
dim sSQL as string
sSQL = "Delete From .rscmdTemp WHERE .rscmdTemp!Sell = 0 AND .rscmdTemp!Breakeven = 0"
rst.Open sSQL, , , , adCmdText
end sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|