What I am doing is setting the two date variables to their respective fields in a Project recorset and the last indexed ascending record in a reporting recordset.
Then I make the date comparison to see it the two dates equal or have changed. If they do not equal .. nTscore always gets set to the value 8.
With prior versions of FWH\xHarbour ( using 8.09 for this example and matching xHarbour from FTDN ) .. the dates :
dLAST_START_DATE <> dSTART_DATE are equal when you send the values to msginfo .. but the comparison fails. In order to get this code functional again .. I had to change the date values to dtoc() and compare them again .. Just thinking that xHarbour may be pulling in the date\time into the string and in the raw form .. the time stamps are different causing the comparison to fail.
Just curious if any of our TOleAuto() SQL experts can confirm what I am seeing ..
Thanks
Rick Lipkin
SC Dept of Health, USA
- Code: Select all Expand view
//----------- code snipit
lLAST := .T.
TRY
oRsRpt:MoveLast()
CATCH
lLAST := .F.
dSTART_DATE := oRsProj:Fields("start_date"):Value
dEND_DATE := oRsProj:Fields("end_date"):Value
nEST_BUDGET := oRsProj:Fields("est_budget"):Value
END TRY
IF lLAST = .T.
dSTART_DATE := oRsRpt:Fields("start_date"):Value
dEND_DATE := oRsRpt:Fields("end_date"):Value
nEST_BUDGET := oRsRpt:Fields("est_budget"):Value
ENDIF
// local .. will be last known value //
dLAST_START_DATE := dSTART_DATE
dLAST_END_DATE := dEND_DATE
nLAST_EST_BUDGET := nEST_BUDGET
// go to data entry here allow to edit or change baseline values from project
REDEFINE GET oSTART_DATE VAR dSTART_DATE ID 146 of oUSERS UPDATE
REDEFINE GET oEND_DATE VAR dEND_DATE ID 147 of oUSERS
UPDATE
REDEFINE GET oEST_BUDGET VAR nEST_BUDGET ID 148 of oUSERS UPDATE
do some radio buttons here then
_ChgBud( oBTN3, cMODE, dLAST_START_DATE, dLAST_END_DATE, nLAST_EST_BUDGET,oBTN6 )
......
Static Func _ChgBud( oBTN3, cMODE, dLAST_START_DATE, dLAST_END_DATE, nLAST_EST_BUDGET,oBTN6 )
// check if any baseline values have changed .. auto red on Add //
IF EMPTY( dLAST_START_DATE )
ELSE
IF dLAST_START_DATE <> dSTART_DATE // <-- errors here when the values are the same .. perhaps now including date\time from SQL table ??
nTSCORE := 8
ENDIF
ENDIF
IF EMPTY( dLAST_END_DATE )
ELSE
IF dLAST_END_DATE <> dEND_DATE
nTSCORE := 8
ENDIF
ENDIF
IF EMPTY( nLAST_EST_BUDGET )
ELSE
IF nLAST_EST_BUDGET <> nEST_BUDGET
nTSCORE := 8
ENDIF
ENDIF