A
Afrosheen via AccessMonster.com
I have a situation where I need to update my table using slq. The information
to be updated has two conditions.
Here is what I have so far.
Dim awk As ADODB.Connection, sql5 As String
150 Set awk = CurrentProject.AccessConnection
170 sql5 = "update tbl_roster set location = '' " & "where shift = 'a-
days'"
190 awk.Execute sql5, , adCmdText + adExecuteNoRecords
220 Set awk = Nothing
What I want to do is to update the tbl_roster [location] = " " & where
[shift] = 'a-days' and [position] = 'custody' The brackets around the
words are the actual fields.
The first part as written is working. It's the added [position] after the 'a-
days' that I don't know how to program to equal two conditions.
Another question is how can I make this a shorter line: stwhere = "([position]
= 'custody'or[position]='sgt'or[position]='lieutenant'or[position]='captain')
and ([shift]='b-days' or [shift] = 'day shift')"
Thanks for your help and reading this post.
I hope this is enough information.
to be updated has two conditions.
Here is what I have so far.
Dim awk As ADODB.Connection, sql5 As String
150 Set awk = CurrentProject.AccessConnection
170 sql5 = "update tbl_roster set location = '' " & "where shift = 'a-
days'"
190 awk.Execute sql5, , adCmdText + adExecuteNoRecords
220 Set awk = Nothing
What I want to do is to update the tbl_roster [location] = " " & where
[shift] = 'a-days' and [position] = 'custody' The brackets around the
words are the actual fields.
The first part as written is working. It's the added [position] after the 'a-
days' that I don't know how to program to equal two conditions.
Another question is how can I make this a shorter line: stwhere = "([position]
= 'custody'or[position]='sgt'or[position]='lieutenant'or[position]='captain')
and ([shift]='b-days' or [shift] = 'day shift')"
Thanks for your help and reading this post.
I hope this is enough information.