Using Memory viarable

  • Thread starter Thread starter Song Su
  • Start date Start date
S

Song Su

I have following:

Dim mYYYY as String, mSem as String
mYYYY="2007"
mSem="3"

How to fix following line to use mYYYY and mSem? I am confused with
single/double quote.

dbs.Execute "DELETE * FROM " & _
"Transcript WHERE yyyy = '2007' and sem = '3';"
 
Song Su said:
I have following:

Dim mYYYY as String, mSem as String
mYYYY="2007"
mSem="3"

How to fix following line to use mYYYY and mSem? I am confused with
single/double quote.

dbs.Execute "DELETE * FROM " & _
"Transcript WHERE yyyy = '2007' and sem = '3';"


Try:

dbs.Execute _
"DELETE * FROM Transcript " & _
"WHERE yyyy = '" & mYYYY & "' and sem = '" & mSem & "';"
 
I have following:

Dim mYYYY as String, mSem as String
mYYYY="2007"
mSem="3"

How to fix following line to use mYYYY and mSem? I am confused with
single/double quote.

dbs.Execute "DELETE * FROM " & _
"Transcript WHERE yyyy = '2007' and sem = '3';"

Concatenate the values of the fields into the string, along with the
singlequote delimiters:

dbs.Execute "DELETE * FROM Transcript WHERE yyyy = '" & mYYYY & "' AND sem =
'" & mSem & "';"


John W. Vinson [MVP]
 
Song said:
I have following:

Dim mYYYY as String, mSem as String
mYYYY="2007"
mSem="3"

How to fix following line to use mYYYY and mSem? I am confused with
single/double quote.

dbs.Execute "DELETE * FROM " & _
"Transcript WHERE yyyy = '2007' and sem = '3';"


dbs.Execute "DELETE * FROM Transcript " & _
"WHERE yyyy = '" & mYYYY & "' And sem = '" & mSem & "' "
 
Back
Top