Home All Groups Group Topic Archive Search About
Author
15 Jan 2007 9:09 PM
VB .NET Rookie
I am trying to extract data from a table with an SQL statements but it is not
working because of my "where=..." 
How do I use a decleared variable as my where, below is an example of my
code...

        Dim datCurDate As Date
        Dim strISODate As String

        datCurDate = Now
        strISODate = Format(datCurDate, "yyyy-MM-dd")
        strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from  
     KITDATA.KMCAL where DATECL=" & strISODate, cn)

When I write it like that it doesn't pull any data now sure how to attach
the delcared variable to the "where".

Thanks in advance

Author
15 Jan 2007 10:35 PM
DK
where DATECL=' " & strISODate & " ' ", cn


VB .NET Rookie wrote:
Show quoteHide quote
> I am trying to extract data from a table with an SQL statements but it is not
> working because of my "where=..."
> How do I use a decleared variable as my where, below is an example of my
> code...
>
>         Dim datCurDate As Date
>         Dim strISODate As String
>
>         datCurDate = Now
>         strISODate = Format(datCurDate, "yyyy-MM-dd")
>         strSelectStr = New IBM.Data.DB2.iSeries.iDB2Command("select * from
>      KITDATA.KMCAL where DATECL=" & strISODate, cn)
>
> When I write it like that it doesn't pull any data now sure how to attach
> the delcared variable to the "where".
>
> Thanks in advance