Thx for the info. I might have to go the temp view with the static date. Dan Goldberg
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Tony IJntema Sent: Tuesday, February 27, 2018 1:23 AM To: [email protected] Subject: RE: [RBASE-L] - speed up when using date calculation (2) Dan, Also worthwhile to know is that if you like to keep the variable in the temp view you have to surround the variable with brackets. In that case you will find the variable in the where clause otherwise the variable is being replaced by the calculated date. It looks like this: SELECT Cust_State,Unit_Type,InquiryDate FROM Inquiry WHERE InquiryDate > (.vDate) OR SELECT Cust_State,Unit_Type,InquiryDate FROM Inquiry WHERE InquiryDate > '2/10/2018' Tony -----Oorspronkelijk bericht----- Van: [email protected] [mailto:[email protected]] Namens Dan Goldberg Verzonden: dinsdag 27 februari 2018 0:49 Aan: [email protected] Onderwerp: RE: [RBASE-L] - speed up when using date calculation 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. -- 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.

