dDate := TtoDate( oRs:Fields("Date"):Value)
...
//--------------------------
Function TtoDate( tDate )
If empty( tDate)
Return( ctod("00/00/00"))
Endif
If ValType( tDate ) = "D"
Return(tDate )
Endif
Return( stod( substr( ttos( tDate ), 1, 8 ) ))
If xDatabase = "A" // ms access
cSQL := "SELECT [AactivEid],[Formno],[TravDate],[Code], "
cSql += "[Desc] as Descrip,[Meals],[Mileage],[Perdiem], "
cSql += "[Air],[Other],[Misc],[Regist],[Lodging] "
cSql += "From [Aactiv] where [Formno] = "+ltrim(str(nFormno))
cSql += " and [TravDate] = #"+dtoc(dDate)+"# Order by [TravDate]"
Else
// sql server or oracle
cSQL := "SELECT [AactivEid],[Formno],[TravDate],[Code], "
cSql += "[Desc] as Descrip,[Meals],[Mileage],[Perdiem], "
cSql += "[Air],[Other],[Misc],[Regist],[Lodging] "
cSql += "From [Aactiv] where [Formno] = "+ltrim(str(nFormno))
cSql += " and [TravDate] = '"+dtoc(dDate)+"' Order by [TravDate]"
Endif
lucasdebeltran wrote:Thank you.
And what about logical fields?.
For example, with Access I use this filter:
cCondicion := "DEVUELTO = 'False'" // revisar MySQL
cCondicion := "DEVUELTO = 0"
TO_DATE()
cCond := "FECHA >= "+ FW_DateToADO( dDate ) +" AND FECHA <= " + FW_DateToADO( dDate )
? cCond
oRs:Filter := cCond
FECHA >= #2013-07-24# AND FECHA <= #2013-07-24#
oCn := FW_OpenAdoConnection( <connstring> )
oRs := FW_OpenRecordSet( oCn, "SELECT * FROM MYTABLE WHERE DOCDATE >= " + FW_DateToSQL( dDate. 'D' ) )
// OR
oRs := FW_OpenRecordSet( <connstring>, "SELECT * FROM MYTABLE WHERE DOCDATE >= " + FW_DateToSQL( dDate, 'D' ) )
dDate := oRs:Fields( n ):Value
cSql := "SELECT * FROM DELIVERIES WHERE DELIVERYDATE = " + FW_DateToSQL( dDate )
cSql := "SELECT * FROM DELIVERIES WHERE DELIVERYDATE >= " + FW_DateToSQL( dDate, 'D' ) AND DELIVERYDATE < FW_DateToSQL( dDate + 1, 'D' )
cSql := "SELECT * FROM DELIVERIES WHERE DELIVERYDATE >= " + FW_DateToSQL( d1, 'D' ) AND DELIVERYDATE < FW_DateToSQL( d2 + 1, 'D' )
lucasdebeltran wrote:About using logical fields, I do for example:
if oRs:Fields( "PRESTA" ):Value = .T.
[..]
But you advise me to use 1 or 0 for logicals as to work with Oracle.
But if I change .t. to 1 I get an error.
lucasdebeltran wrote:Mr. Nages,
Thank you very much.
About using logical fields, I do for example:
if oRs:Fields( "PRESTA" ):Value = .T.
[..]
But you advise me to use 1 or 0 for logicals as to work with Oracle.
But if I change .t. to 1 I get an error.
Thank you very much.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 56 guests