Dan,
This is a silly idea which might be worth a try. If you create a table for
that purpose:
TableName CurrentDate_LessDays
ColumnName Type DEFAULT ComputedColumnExpression
CurrentDate DATE .#DATE
LessDays INTEGER 90
LessDate DATE (CurrentDate – LessDays)
All you need is one row – update the CurrentDate and/or the LessDays at will.
Simply join CurrentDate_LessDays.LessDate in place of (.#date - 90)
Sounds a bit ridiculous, but it just may work. 😊
Steve Sweeney
From: 'Daniel Goldberg' via RBASE-L <[email protected]>
Sent: Thursday, December 12, 2024 2:41 PM
To: [email protected]
Subject: [RBASE-L] - date minus slow
I have a select statement running in oterro.
SELECT INVOICE.INVOICENUM, INVOICE.DLRNAME, INVOICE.SHIPNAME,
INVOICE.PURCHSENUM, INVOICE.ORDERBY, INVOICE.ORDDATE, INVOICE.SHIPDATE,
INVOICE.SHIPVIA, INVOICE.INVBO
FROM INVOICE inner join useraccess on INVOICE.dlrnum = useraccess.dlrnum where
(useraccess.logon_name = 'sw059') and INVOICE.orddate > (.#date - 90) order by
orddate desc
It runs but slow. I have narrowed the slowness down to the (.#date – 90), which
brings up orders 90 days and newer. If I change it to 9/12/2024, the results
come up instantly.
I was wondering if anyone had another way to bring up the last 90 days. Since
it is oterro I cannot set a variable before it runs.
TIA
Dan Goldberg
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
[email protected]<mailto:[email protected]>.
To view this discussion visit
https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027E860666B2BC483579510D43F2%40BY3PR19MB5027.namprd19.prod.outlook.com<https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027E860666B2BC483579510D43F2%40BY3PR19MB5027.namprd19.prod.outlook.com?utm_medium=email&utm_source=footer>.
--
For group guidelines, visit
http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/rbase-l/BYAPR03MB37182BD931A99385B42F9DAD893F2%40BYAPR03MB3718.namprd03.prod.outlook.com.