An attractive solution. Might the target column(s) best be calculated, or updated by an automated daily routine?

Bruce Chitiea



------ Original Message ------
From "'Daniel Goldberg' via RBASE-L" <[email protected]>
To "[email protected]" <[email protected]>
Date 12/13/2024 9:07:19 AM
Subject RE: [EXTERNAL] [RBASE-L] - RE: date minus slow

That would work too but I have multiple tables that looks at days. So I am thinking I can use sweenys table and add rows for 90 30 45 days. Then in my nightly routine it will repopulate it with the current days calculated.







Dan Goldberg



From: 'Karen Tellef' via RBASE-L <[email protected]>
Sent: Friday, December 13, 2024 7:35 AM
To: 'Daniel Goldberg' via RBASE-L <[email protected]>
Subject: Re: [EXTERNAL] [RBASE-L] - RE: date minus slow



I was gonna suggest something similar, but thought "no that'd be too silly". But here goes.



If you can, add another column to the Invoice table. You can even call it DateCol. Before you do your Select command, do an update to "set datecol = (.#date - 90)"



Then you can say "orddate > datecol". Keeping it all in one table will greatly reduce the time compared to introducing another table. If you CAN add a column (or sometimes I find columns in a table that are no longer used, check for unused date columns?)





Karen







On Friday, December 13, 2024 at 08:00:17 AM CST, 'Daniel Goldberg' via RBASE-L <[email protected]> wrote:





Hmm interesting idea. got the wheels spinning…



Thanks



Dan Goldberg





From:[email protected] <[email protected]> On Behalf Of Steve Sweeney
Sent: Thursday, December 12, 2024 3:39 PM
To:[email protected]
Subject: [EXTERNAL] [RBASE-L] - RE: date minus slow



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 <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/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 <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 <https://groups.google.com/d/msgid/rbase-l/BYAPR03MB37182BD931A99385B42F9DAD893F2%40BYAPR03MB3718.namprd03.prod.outlook.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <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/BY3PR19MB5027794BE8C372AA765ACD8FD4382%40BY3PR19MB5027.namprd19.prod.outlook.com <https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027794BE8C372AA765ACD8FD4382%40BY3PR19MB5027.namprd19.prod.outlook.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php <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/1002726294.2554697.1734104086994%40mail.yahoo.com <https://groups.google.com/d/msgid/rbase-l/1002726294.2554697.1734104086994%40mail.yahoo.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/BY3PR19MB5027A441C1931E01A2A3C17AD4382%40BY3PR19MB5027.namprd19.prod.outlook.com <https://groups.google.com/d/msgid/rbase-l/BY3PR19MB5027A441C1931E01A2A3C17AD4382%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/emd8e69320-041b-4d43-87e0-08708390d43e%40a413b759.com.

Reply via email to