Re: Wild Character Help



On Mar 13, 11:03 am, Playa <P...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
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.

If I'm not mistaken, it looks like you have an extra apostrophe around
the intCardDate value. To make sure you should try setting a variable
and using string.format like so:

dim sQuery as String = String.Format("Select * From KITDATA.CKTIMEFLK5
Where TICONO=1 and TIEMPN = 1710 and TIRTIM Like '{0}%'",intCardDate)

Then set the Command's CommandText to squery. If that doesn't work
then I'd break in the debugger and copy the value out for sQuery and
try running it manually against the data source to verify your syntax.



.