I have successfully written a Sql script that takes the Sql Field [InvoiceNumber] Integer and converted it to character with this script and it works :
- Code: Select all Expand view
cSql := "Select str(InvoiceNumber) as InvoiceNumber, "
cSql += "CustomerId "
cSql += "From Billing"
oRsInv := TOleAuto():New( "ADODB.Recordset" )
oRsInv:CursorType := 1 // opendkeyset
oRsInv:CursorLocation := 3 // local cache
oRsInv:LockType := 3 // lockoportunistic
TRY
oRsInv:Open( cSQL,xCONNECT )
CATCH oErr
MsgInfo( "Error in Opening Invoice Number table" )
oRsCust:Close()
oRsBill:Close()
_CleanUP()
oDlg:End()
RETURN(.F.)
END TRY
xbrowse(oRsInv )
oRsInv:Filter := "InvoiceNumber = '10'"
xbrowse( oRsInv )
As you can see .. [InvoiceNumber] has been converted to Charactor .. however, creating a filter on the converted [InvoiceNumber] fails ???
Any Ideas ?
Rick Lipkin