woensdag 15 juli 2009

How to compare Date type field with Datetime type field?

The validFromDatetime field from the HRPPartyPositionTableRelationship is an Datetime type field and the projTransDate field from the projJournalTable an date type field in the example below.

// Example begin
Timezone timezone = DateTimeUtil::getUserPreferredTimeZone();
;

while select positionTable
where positionTable.HRMReferenceType == 0
&& positionTable.Reference == EmplTable.EmplId
&& positionTable.ValidFromDateTime >= datetobeginUtcDateTime(projJournalTable.ProjTransDate, timezone)
&& positionTable.ValidToDateTime <= datetobeginUtcDateTime(projJournalTable.ProjTransDate, timezone)
{
error("error message");
return;
}
// Example end

Geen opmerkingen:

Een reactie posten