G
Guest
I am trying to use a wild character in the LIKE part of my select statement
for connecting to an AS400 database table and can't get it to work properly.
I can get it to work when I hard code the value in. See below...
strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from
LIBRARY.CKTIMEFLK5 where TICONO=1 and TIEMPN= 1710 and TIRTIM
LIKE '20070207%'", cn)
However when I try to use a variable that is holding the value I can't get
it to work properly. Below is one of the methods I tried, however it doesn't
match a record and I know that 20070207 is the value of intCardDate.
strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from
KITDATA.CKTIMEFLK5 where TICONO=1 and TIEMPN= 1710 and TIRTIM LIKE '" &
"'" & intCardDate & "'%'" & "'" & "'", cn)
Can anyone help me out with how I should properly code my LIKE statement.
Thanks in advance.
for connecting to an AS400 database table and can't get it to work properly.
I can get it to work when I hard code the value in. See below...
strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from
LIBRARY.CKTIMEFLK5 where TICONO=1 and TIEMPN= 1710 and TIRTIM
LIKE '20070207%'", cn)
However when I try to use a variable that is holding the value I can't get
it to work properly. Below is one of the methods I tried, however it doesn't
match a record and I know that 20070207 is the value of intCardDate.
strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from
KITDATA.CKTIMEFLK5 where TICONO=1 and TIEMPN= 1710 and TIRTIM LIKE '" &
"'" & intCardDate & "'%'" & "'" & "'", cn)
Can anyone help me out with how I should properly code my LIKE statement.
Thanks in advance.