Product(s): | ProjectWise V8i | ||
Version(s): | 08.11.05.37 | ||
Area: | General | ||
Original Author: | Bentley Technical Support Group |
First attribute has date, want 2nd attribute take that date and add one day
I have a user who explains her problem
I have one attribute A, WHICH HAVE DATE... 03-jUL-09.
I want to create another attribute B, which should be A + ONE DAY..
The answer should be 04-Jul-09.
Do you have a select statement for me?
I could not get it to work correctly with a SQL statement but you could use a trigger or stored proc.
In my test case I set up an environment called 'mydates'
My environment table name was mydates
I created two attributes as either of these two data types datetime or timestamp
And the attribute names where mydate1, mydate2
I then created a trigger using SQL query:
CREATE TRIGGER myDateTrig ON mydates
FOR INSERT, UPDATE
AS
UPDATE mydates set mydate2 =
(SELECT dateadd(day, 1, mydate1)
FROM inserted I)
RETURN
(This trigger was created for MS SQL 2005 and may be different for Oracle)
In ProjectWise explorer, I added a file and then went to the properties attribute tab of the file.
I entered in a date for mydate1 and then clicked save and at that point mydate2 populated with the next days date.
The key is that if you change mydate1 you have to hit save for mydate2 to update.
customizing an environment is something that Bentley Professional Services should be retained to do. If you have any further customizations then please contact Bentley Professional Services via your Bentley Account Manager.
Bentley Technical Support KnowledgeBase
Bentley's Technical Support Group requests that you please confine any comments you have on this Wiki entry to this "Comments or Corrections?" section. THANK YOU!