Warm tip: This article is reproduced from serverfault.com, please click

oContacts.Items.Restrict Misses Some Contacts

发布于 2020-12-03 16:15:08

I've been using oContacts.Items.Restrict to determine if a Contact having the same Lastname, Firstname, and Birthday exists. In this case oContacts references iCloud\Contacts. Most of the time it works; but for a significant number of contacts known to exist and created with the same code, the count is 0 when I know that it should be at least 1.

Full Disclosure: I posted this question at Forums.SlipStick.com for few days; but, after more than 240 views have not received any replies I'm hoping someone here can point me in the right direction. FYI, I looked for any instructions regarding cross-posting and did not find any recommended procedures. I trust my acknowledging it will keep me out of any penalty box. Thanks.

The post at SlipStick contains more detail; however, including that detail here prevented me from posting because it "looks like spam". Not sure why, but OK.

Bruce

Questioner
BCVolkert
Viewed
0
Dmitry Streblechenko 2020-12-04 02:21:34

Firstly, you really need to post all the details here, not just give a link to your first question.

Secondly, never use = with date-time fields (such as Birthday) - the condition might not be satisfied because of the rounding errors. Always use a range instead.

Also note that 1/1/4501 is just what Outlook returns for the missing date-time values (since it cannot return null for a scalar value). Take a look at the contact with OutlookSpy (select the contact, click IMessage button).