Hello folks ! How can I use CASE WHEN statement on excel vba ? I'm using
excel sheet like database I did :
dim db as dao.database
dim rs as dao.recordset
dim cSQL as string
set db=opendatabase(thisworkbook.path & "\" &
thisworkbook.name,false,false,"Excel 8.0")
cSQL="select cd_codigo, (case when cd_hist=1 then valor else 0 end), (case
when cd_hist=2 then valor else 0 end) from [Plan1$]"
set rs=db.openrecordset(cSQL)
but this code make a error. Why ?
regards.
Bookmarks