Thx for the info. Example 1 runs but takes forever. Example 2 runs fast but I need to find a way to not use variables as this is a webpage.
I will keep exploring options. Dan Goldberg -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of A. Razzak Memon Sent: Monday, February 26, 2018 3:24 PM To: [email protected] Subject: Re: [RBASE-L] - speed up when using date calculation Dan, What happens when you use the syntax with WHERE clause as follows: -- Example 01 SELECT ID,Cust_State,Unit_Type,InquiryDate + FROM Inquiry + WHERE InquiryDate > (ADDDAY(.#DATE,-15)) RETURN -- Example 02 SET VAR vDate DATE = (ADDDAY(.#DATE,-15)) SELECT ID,Cust_State,Unit_Type,InquiryDate + FROM Inquiry + WHERE InquiryDate > .vDate CLEAR VARIABLE vDate RETURN Very Best R:egards, Razzak At 06:13 PM 2/26/2018, Dan Goldberg wrote: >I want to get data from the last 14 days to current. > >I have a view with the following syntax: > >SELECT T1.ID,T1.cust_state,T1.Unit_Type,T1.InquiryDate >FROM Inquiry T1 >WHERE T1.InquiryDate > (.#date – 15) > >It is very slow and takes a long time to process > >But if I do: > >SELECT T1.ID,T1.cust_state,T1.Unit_Type,T1.InquiryDate >FROM Inquiry T1 >WHERE T1.InquiryDate > 2/10/2018 > >It opens right away. > >I know that it is processing row by row when you have the date like >(.#date – 15) but is there a way to force it to process like the >static. I cannot use variables -- 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]. For more options, visit https://groups.google.com/d/optout. -- 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]. For more options, visit https://groups.google.com/d/optout.

