Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
2
Erster Beitrag:
vor 2 Jahren, 10 Monaten
Letzter Beitrag:
vor 2 Jahren, 10 Monaten
Beteiligte Autoren:
Paulo Oliveira, Joel

WB15 - Can someone explain why the first method works, but not the second?

Startbeitrag von Joelam 10.07.2010 17:19

Can anyone explain to me why method #1 doesn't work? I know for a fact that there are records that match the query, (I checked it in the hyperfile control center, plus, it works with method #2 below) but I always get a return result of 0 for method #1.

Method #1
HExecuteQuery(QRY_Clients_GetActive)
FOR ALL QRY_Clients_GetActive
//Search for Active Memberships for Client
bDone is boolean = HExecuteQuery(QRY_Memberships_Active_ByDatesNotStatusFlag_withParamContactID,hQueryDefault,...
QRY_Clients_GetActive.GUIDHFContact,Today())
IF bDone = True THEN
i is int = HNbRec(QRY_Memberships_Active_ByDatesNotStatusFlag_withParamContactID)
Trace(i) //Should sometimes return >0, but it doesn't
END
END

Here is the sql code of QRY_Memberships_Active_ByDatesNotStatusFlag_withParamContactID:
SELECT
HFMemberships.GUIDHFMemberships AS GUIDHFMemberships,
HFMemberships.GUIDHFContact AS GUIDHFContact,
HFMemberships.dStartDate AS dStartDate,
HFMemberships.dEndDate AS dEndDate,
HFMemberships.bMembership_Dropped AS bMembership_Dropped
FROM
HFMemberships
WHERE
HFMemberships.bMembership_Dropped 1
AND HFMemberships.dStartDate {ParamTodaysDate}
AND HFMemberships.GUIDHFContact = {ParamContactID}




Method #2 (This method works just fine)
HExecuteQuery(QRY_Clients_GetActive)
FOR ALL QRY_Clients_GetActive
FOR EACH HFMemberships WHERE GUIDHFContact = QRY_Clients_GetActive.GUIDHFContact
IF HFMemberships.dStartDate Today() AND

HFMemberships.bMembership_Dropped 1 THEN
Trace("WE'VE GOT A WINNER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
BREAK
ELSE
Trace("0")
END
END
END

I see these two methods as the same, but they don't work the same. Any help would be greatly appreciated.
Antworten:
The order of the parameter are ok?

did you test like this:
QRY_Memberships_Active_ByDatesNotStatusFlag_withParamContactID.ParamTodaysDate=Today()
QRY_Memberships_Active_ByDatesNotStatusFlag_withParamContactID.ParamContactID=QRY_Clients_GetActive.GUIDHFContact
HExecuteQuery(QRY_Memberships_Active_ByDatesNotStatusFlag_withParamContactID,hQueryDefault)

von Paulo Oliveira - am 12.07.2010 11:20
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.