I wasn't able to solve the problem so I ended up hard-coding it. I'm still very interested on hearing a dynamic way of doing it. I intend to achieve this at Universe level rather than database level. I use SQL server 2012
Hi,
Could you please assist. Currently using BO version 4.1 SP6
I have a task of creating a Year to LastMonthEnd filter for both current & previous year. Our financial year starts from 1st Sept. I'm trying to avoid hardcoding the date in the filter but to make it more dynamic.
DATE Between...
Thanks gmmastros for your great assistance. I tried different approach as below but with the initial guidance from you and it's working very well.
Insert
Into History(PtN, PtCt, StartDateTime, EndDateTime)
Select I.PtN, I.PtCt, GetDate(), NULL
From Inserted I
INNER JOIN Deleted d
on...
Hi gmmastros, thank you so much. The startdatetime is working perfectly well as I expected and it writes a new record each time the value of PtCt =0, but the EndDateTime isn't yet. Instead what it's currently doing is defaulting all the records with same enddatetime as at the time the value...
Yes the original table has unique id (Pk) which is PtN. The table only holds one record for each PtN at any point in time. So, I’m trying to build a history table to record all the changes that occur on that table since it only shows the current status. See table layout below
PtN | PtCt |
Pt1...
Hi Philhege, apologies if my explanation wasn't clear. I have rephrased it, see table below
PtN | PtCt | StartDateTime | EndDateTime
Pt1 | 0 | getdate()* | getdate()**
Pt1 | 0 | getdate()* | getdate()**
When the value of PtCt = 0 then getdate()* and when it changes from 0 to another...
Hi gk53, Yes column PtCt is the field that should fire the trigger once there's a change. I intend to use getdate() to generate the timestamp which will populate startdatetime when PtCt =0 and another getdate() to populate enddatetime when PtCt value changes from 0 to any other number. I hope my...
Hi,
I'm a newbie in writing triggers and would appreciate if you could please assist. I want to capture a startdatetime and enddatetime each time PtCt changes value, when this condition is met i.e If(PtCt = 0, Insert timestamp(StartDateTime)) and when the value of PtCt changes from 0 to any...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.