Mark HHP Forgive me but I struggle with time and date rules. I have a Clients object with a CreateDate attribute. (date, set to CURRENT_DATE by default) I have a query that runs that pulls all of the Clients created that day but how would you do for a week? I'm always confused when it comes to using DATE_PART etc.
Mark HHP Reading the rule reference guide, I see it makes mention of "for example, Account.OpeningDate + 7 produces a date that is a week after the account opening date. " So how could I use something that in my equation?
chris29 Hi Try Current Week FIND BO WHERE WEEK(BO.CreateDate)=CURRENT_WEEK Previous Week FIND BO WHERE WEEK(BO.CreateDate-1)=CURRENT_WEEK-1
Mark HHP Argh, I get so frustrated by all of these simple problems tripping me up. But I guess you live and you learn 🙂 Thanks so much.
Mark HHP Hmm, actually, no. This throws back empty results. My object group is Clients, looking at Clients.CreateDate. The CreateDate attribute is set as Date with initial value set as CURRENT_DATE, calculated, format is DD/mm/yy.
crisg0112 I just tried FIND Client.CreateDate WHERE WEEK(Client.CreateDate)=CURRENT_WEEK and it returned all the rows from 18/01/2015 - 24/01/2015 Isn't this what you're after Mark?
Mark HHP Hi Cris, I tried this and again got a blank result. (And should it not be FIND Client WHERE WEEK(Client.CreateDate)=CURRENT_WEEK?) Yet, if I run FIND Client WHERE Client.CreateDate=CURRENT_DATE I get a full list. A note: I have an object called Client and another called AgencyClient and both sit within a group called Clients, so that's why my terminology changes, they're both correct.
tford If you store the week # creatred in the client record & the current week number in the SystemSettings BO, you can easily query.
crisg0112 Mark HHP wroteHi Cris, I tried this and again got a blank result. (And should it not be FIND Client WHERE WEEK(Client.CreateDate)=CURRENT_WEEK?) Yet, if I run FIND Client WHERE Client.CreateDate=CURRENT_DATE I get a full list. A note: I have an object called Client and another called AgencyClient and both sit within a group called Clients, so that's why my terminology changes, they're both correct. Hi, Yes the it should be WEEK(Client.CreateDate)=CURRENT_WEEK. Do you mind posting a sample bsv?