Code: Select all
cSql="SELECT campo1,campo2,campo3,campo4 FROM TABLA where (campo1='10') and (campo2='2012')"
Code: Select all
cSql:="SELECT campo1,campo2,campo3,campo4 FROM TABLA where (campo1='"+cmon+"') and (campo2='"+cyea+"')"
Muchas gracias
Code: Select all
cSql="SELECT campo1,campo2,campo3,campo4 FROM TABLA where (campo1='10') and (campo2='2012')"
Code: Select all
cSql:="SELECT campo1,campo2,campo3,campo4 FROM TABLA where (campo1='"+cmon+"') and (campo2='"+cyea+"')"
Code: Select all
cSql := "SELECT campo1,campo2,campo3,campo4 From TABLA "
cSql += "Where campo1 = '"+cmon+"' and campo2 = '"+cyea+"'"
Code: Select all
cSql := "SELECT campo1,campo2,campo3,campo4 FROM TABLA where (campo1=%1) and (campo2=%2)"
cSql := strformat( cSql, Var2Str( 10 ), var2Str( 2012 ) )
?cSql
Code: Select all
FUNCTION Var2Str( xValue )
LOCAL cValue := "''"
DO CASE
CASE HB_IsString( xValue )
cValue := "'" + xValue + "'"
CASE HB_IsNumeric( xValue )
cValue := AllTrim( CStr( xValue ) )
CASE HB_IsLogical( xValue )
cValue := IIf( xValue, 'True', 'False' )
CASE HB_IsDate( xValue )
cValue := "'" + DToC( xValue ) + "'"
CASE HB_IsDateTime( xValue )
cValue := "'" + TToC( xValue ) + "'"
ENDCASE
RETURN cValue