X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Wolfgang Hartmann" Received: from [40.92.73.64] (HELO EUR04-HE1-obe.outbound.protection.outlook.com) by selbstdenker.ag (CommuniGate Pro SMTP 6.3.7) with ESMTPS id 26743972 for webobjects-dev@wocommunity.org; Fri, 05 Nov 2021 08:17:14 +0100 Received-SPF: pass receiver=post.selbstdenker.com; client-ip=40.92.73.64; envelope-from=halbeisen@hotmail.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tx2AUuFhzPXpOCOSKROJySUm7iwOXCLfe4IYCv7cxCmXfiul0TuTExBRUATGp4HfZlRQKued9gXxxKGHU9MzXOTGwhh0MEp4KtoiBhZ3Eh8+MF7wKrwxI3DI4wfZdRHJagTJ3wxG9MxX2JdTfL0lrqa5xSty+ttMun7YU0u8pYr6hH/Ao1sBK0YB7BA8WnUsCnruhoL7lSqpnINJkziD0WG9pWJXtCIbZ3lbVcgDDA+IVIrcezBuZt76aIIX3ZtP4S3DEvHYBY6+tO8i3fprN5oZ5ziTZ6jKvpyd7wZ/h2y20c7AXzqalWpFMWrva/1FfSTtYtlaBIj+9f65cycDkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TrR8XPXFybWArKDeA8zS1j3xH3CrS434U7U7YtqKnqs=; b=gV5/Xi5eYl+OCKWy4NDEGhei47VujuF3y9wEWS/JzU7E3bZ075VzP9AzSzk0XqA017BdXhaUEHXlBx6WMQdPddWQYwtRXxnweDJG5oxZSlD/hIr3GgQh8zKVf+KmOxu6g/vJA+KnwE3d4J46D6BUfMnCU0YPg6EvFq2ofMvq05u+gOk2xep3D0/1IN/Gw02NZBQmF0BZnyTEbj6WZBQ2S4UFQnmeTmMh27djdiiOSIbZDESuGIzNXBLA9RMAUPDjurJXujGCrB2xZT7QqGPYs2XcteDValixsAvOEiP1PtOZfeN2wISzdkRoI6B1lh8dpD+JOWjk0o1HsfATJKIwGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TrR8XPXFybWArKDeA8zS1j3xH3CrS434U7U7YtqKnqs=; b=DP6o5bs9uwmE5Qv/I4oPDObRdk83BtXYkE0gZoqHRKt9gfwq/BLUUWtGOCa0OGQIAmYDDJWKv4wpAArVRftkCeiQXf2lVeVsVPIUWBEMiZ8uNITdwYxZVZvHxKTplcvIAiFOdAG57CZGtPzfDGTKM75Ljbce6kF0JjMHWhZBejbWCAeo2kIPkshoR52Bi4l6M/lDSorVGWJaTzfnvfXnlwsFIcIr4KIuiFKVCadRm3n/cRFy2K3/qzL8iwsPKi25oriPAhuQoqjjk5Y7tNcpGE7FOUTQLLQ5wlmm6QR9IObW2eVsmGg6lI6aDwV38R+1WAnU8qpml8VzEs9fOEhubA== Received: from VI1PR0202MB3408.eurprd02.prod.outlook.com (2603:10a6:803:20::14) by VE1PR02MB5696.eurprd02.prod.outlook.com (2603:10a6:803:112::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Fri, 5 Nov 2021 07:16:53 +0000 Received: from VI1PR0202MB3408.eurprd02.prod.outlook.com ([fe80::2035:82bc:2b8d:22d0]) by VI1PR0202MB3408.eurprd02.prod.outlook.com ([fe80::2035:82bc:2b8d:22d0%4]) with mapi id 15.20.4649.021; Fri, 5 Nov 2021 07:16:53 +0000 To: WebObjects & WOnder Development Subject: Re: [WO-DEV] Re: How would you create such an EOQualifier representing Postgresql date_trunc(...)? Thread-Topic: [WO-DEV] Re: How would you create such an EOQualifier representing Postgresql date_trunc(...)? Thread-Index: AQHX0WSPCVN5tbxBlUOIwzHTU8s8oqv0hguJ Date: Fri, 5 Nov 2021 07:16:52 +0000 Message-ID: References: In-Reply-To: Accept-Language: de-AT, en-US Content-Language: de-AT X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [/BQPmGuAQ9B7xEpwlKNS9L9xHLjylRUP] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dc2092cf-bce2-4d0c-7081-08d9a02c3e19 x-ms-traffictypediagnostic: VE1PR02MB5696: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QsvRigM5M1+FOkCLr2Fl/H5qmMzqyUwgEa+o8WLNIn5z4X2kQueF0+vBrQYnAkXANJdYQMUK2fnN5FrxhlG7jv1wCvwsqOycoHs9/sTbFq8h66ikaujmv8/J2wn3q10U8Z9ZsE3TeaY9suI/ulnZ6KbzbNbPkBuKIVYXGMYxw07LED0P731uv+X3VjDLEoljfKFg8P+5CFiILKzf98Hatc3wJmG0OxCaDveqIj0n0c4Qs0Yt2B76JI87DzA///t53jKjzB9YqG7aAdwBbZfF6FLPgMfcrtpH26lzGYHkoz/NW5GGw/dHyT6s2MeIvTA0PNTfbH0f4vU5lfR5mwmd7jgsYpd3dUJ4uAGpLGHvSJYvJIuJ86Dz6o7kmbHfH2169vatU9mtfoQf63ozck2Yh8ux/hpVPbAQn6F5Edxaygo1NlR8gb4Sux/7vfVRDD6eNv5UHOBJSlbrCk4c78bfcqZBNYLUPLsaXzPiCIkj9zeXz1FTv4A8i6FkTTxmiL5F1mvIOm3UYb9AD5bshNrqhFA46IJpU1sjRkMxFnTSwxqSXG/wMgW6kiLjELdQSYsozAcsm1vNx+LuzLBe3UNfhg== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: 04c+/TRl1WfsJNz2/AIIYbX9wZJXzXEYoHqVAidPzXJaK9w00aJyOqCuXVxLR1ehlVsRaLkZ7Y11QZO46Z52kLbvmPd0sWHdobnatFcMdfSwyFGH7Yf7ekCm7+ZAXug+8b971UPjcFKwL4afcz26oz9PV4ciVu2TagV1YMgICQcHprZ/Z6rAX2kjwV4gCHQJr8emWE68pG4mPQk6v+/2k3Kr3QZMTwiiEjaEBs38VdUo1e3GhG2JqSGzthSZEtVUFQ25GIsJA8Oj5HYDsEqGTkQtuSeP7Eo9iyQkWZL70kaUYxjJ0/pE76ffhjGe0sTP82vSP/REMgUH+dV57DFd3dsDt0ee7qZIYphBZl4BedtdBMdo5er2+lcqFiRaCR/iPtPV/Xs1pCFysMJDNe3KrD9vKI8XBk1AfVmOYGSy6c3lx9qE08NCLAGQxEBKVD+ADYbxuyTazlor1eY6eK4rtz+doaE0vUmgDdkOAuX1oxjzNjJi59wFuPo01xpXLq5vOUjGSpmvh6LX1pQu1nxHK7a7BDUXV1I0DSEvnJD56PA8BpXUGEL7tqDvQ07s5t96phcUjWyoSMJBAtUSyFK/HduCmpsi9Znhk7lrOtU+hy14N7bON4dF4h8seOXHHgeSyOpukdfJ5jZ0XwWL1a9X1m5jd1iGBKneZFPVUrf3tV8DYcMzq2YZ5zx5NxOh1Ds3sA3W9HSLN96VI57EKB8DeA== Content-Type: multipart/alternative; boundary="_000_VI1PR0202MB3408130D46A3A75D0C11E740BC8E9VI1PR0202MB3408_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-3174-20-msonline-outlook-d375b.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR0202MB3408.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: dc2092cf-bce2-4d0c-7081-08d9a02c3e19 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Nov 2021 07:16:52.9945 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR02MB5696 --_000_VI1PR0202MB3408130D46A3A75D0C11E740BC8E9VI1PR0202MB3408_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Another alternative: Assuming your requested date is in variable "today" which is already trunca= ted to time 00:00: ERQ.And( CheckInTime greaterThanOrEqual today, CheckInTime lessThan today.AddDays(1) ) Then your code would be db-independent. Best Regards, Wolfy ________________________________ From: WebObjects & WOnder Development on b= ehalf of Hugi Thordarson Sent: Thursday, November 4, 2021 11:12:40 AM To: WebObjects & WOnder Development Subject: [WO-DEV] Re: How would you create such an EOQualifier representing= Postgresql date_trunc(...)? Could also use a read format. Just tested this and seems to work: https://gist.github.com/hugith/c97ec7b15b29db8912506db75af9f412 Then there's good old EOSQLQualifier. It's deprecated, but what isn't these= days :) new EOSQLQualifier( EOUtilities.entityNamed( ec, "SomeEntityName" ), "date_= trunc('day', CHECK_IN_TIME) >=3D date_trunc('day', REQUESTED)", null ); - hugi > On 3 Nov 2021, at 22:15, Ramsey Gurley w= rote: > > Hi Markus, > > You could create a derived attribute in your model for the truncated valu= e, but it would calculate that every time you fetch rows as well. > > Ramsey > >> On Nov 3, 2021, at 9:48 PM, Markus Ruggiero (rucotec) wrote: >> >> No one? >> I can live with raw rows but would have been great if anyone knows >> >> ---markus--- >> >>> On 1 Nov 2021, at 12:54, Markus Ruggiero (rucotec) wrote: >>> >>> Need to find objects satisfying the following condition: >>> >>> CHECK_IN_TIME must be at least on the same day or later than REQUESTED.= Both values are stored as NSTimestamp with a 15 minutes precision. >>> >>> In Postgres I would write >>> >>> ...where date_trunc('day', CHECK_IN_TIME) >=3D date_trunc('day', REQUES= TED) >>> >>> How can I create a qualifier for this? Is this possible at all or do I = have to resort to raw rows for SQL? >>> >>> Thanks >>> ---markus--- >>> >>> >>> >>> Markus Ruggiero >>> >>> rucotec GmbH web https://rucotec.ch >>> Steinenvorstadt 79 email markus.ruggiero@rucotec.ch >>> 4051 Basel / Switzerland mobile +41 79 508 4701 >>> >>> >>> >>> >>> >>> >>> >>> >> >> > > Confidentiality Notice: This email, including all attachments and replies= thereto, are covered by the Electronic Communications Privacy Act, 18 U.S.= C. Sections 2510-2521 and are legally privileged. This information is confi= dential, and intended only for the use of the individuals or entities named= above. If you are not the intended recipient, you are hereby notified that= any disclosure, copying, distribution or the taking of any action in relia= nce on the contents of this transmitted information is strictly prohibited.= Please notify us if you have received this transmission in error. Thank yo= u. ############################################################# This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to To switch to the INDEX mode, E-mail to Send administrative queries to --_000_VI1PR0202MB3408130D46A3A75D0C11E740BC8E9VI1PR0202MB3408_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Another alternative:

Assuming your requested date is in variable "today" which is alre= ady truncated to time 00:00:

ERQ.And(
CheckInTime greaterThanOrEqual today,
CheckInTime lessThan today.AddDays(1)
)
Then your code would be db-independent.

Best Regards,
Wolfy

From: WebObjects & WOnd= er Development <webobjects-dev@wocommunity.org> on behalf of Hugi Tho= rdarson <webobjects-dev@wocommunity.org>
Sent: Thursday, November 4, 2021 11:12:40 AM
To: WebObjects & WOnder Development <webobjects-dev@wocommuni= ty.org>
Subject: [WO-DEV] Re: How would you create such an EOQualifier repre= senting Postgresql date_trunc(...)?
 
Could also use a read format. Just tested this and= seems to work:

https://gist.github.com/hugith/c97ec7b15b29db8912506db75af9f412

Then there's good old EOSQLQualifier. It's deprecated, but what isn't these= days :)

new EOSQLQualifier( EOUtilities.entityNamed( ec, "SomeEntityName"= ), "date_trunc('day', CHECK_IN_TIME) >=3D date_trunc('day', REQUES= TED)", null );

- hugi



> On 3 Nov 2021, at 22:15, Ramsey Gurley <webobjects-dev@wocommunity.= org> wrote:
>
> Hi Markus,
>
> You could create a derived attribute in your model for the truncated v= alue, but it would calculate that every time you fetch rows as well.
>
> Ramsey
>
>> On Nov 3, 2021, at 9:48 PM, Markus Ruggiero (rucotec) <webobjec= ts-dev@wocommunity.org> wrote:
>>
>> No one?
>> I can live with raw rows but would have been great if anyone knows=
>>
>> ---markus---
>>
>>> On 1 Nov 2021, at 12:54, Markus Ruggiero (rucotec) <webobje= cts-dev@wocommunity.org> wrote:
>>>
>>> Need to find objects satisfying the following condition:
>>>
>>> CHECK_IN_TIME must be at least on the same day or later than R= EQUESTED. Both values are stored as NSTimestamp with a 15 minutes precision= .
>>>
>>> In Postgres I would write
>>>
>>> ...where date_trunc('day', CHECK_IN_TIME) >=3D date_trunc('= day', REQUESTED)
>>>
>>> How can I create a qualifier for this? Is this possible at all= or do I have to resort to raw rows for SQL?
>>>
>>> Thanks
>>> ---markus---
>>>
>>>
>>>
>>> Markus Ruggiero
>>>
>>> rucotec GmbH        &n= bsp;            = ;   web https://rucotec.ch
>>> Steinenvorstadt 79       &n= bsp;        email markus.ruggiero@rucote= c.ch
>>> 4051 Basel / Switzerland      &n= bsp;  mobile +41 79 508 4701
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
> Confidentiality Notice: This email, including all attachments and repl= ies thereto, are covered by the Electronic Communications Privacy Act, 18 U= .S.C. Sections 2510-2521 and are legally privileged. This information is co= nfidential, and intended only for the use of the individuals or entities named above. If you are not the intende= d recipient, you are hereby notified that any disclosure, copying, distribu= tion or the taking of any action in reliance on the contents of this transm= itted information is strictly prohibited. Please notify us if you have received this transmission in error. Thank yo= u.


#############################################################
This message is sent to you because you are subscribed to
  the mailing list <webobjects-dev@wocommunity.org>.
To unsubscribe, E-mail to: <webobjects-dev-off@wocommunity.org>
To switch to the DIGEST mode, E-mail to <webobjects-dev-digest@wocommuni= ty.org>
To switch to the INDEX mode, E-mail to <webobjects-dev-index@wocommunity= .org>
Send administrative queries to  <webobjects-dev-request@wocommunity= .org>

--_000_VI1PR0202MB3408130D46A3A75D0C11E740BC8E9VI1PR0202MB3408_--