Viewing 15 posts - 1 through 15 (of 20 total)
Right this time i think i have solved it.
ALTER TRIGGER tg_UpdateTraining
ON Training
AFTER UPDATE
AS
BEGIN
INSERT INTO trainingHist
(
training_Type,
completed_Date,
...
April 9, 2012 at 11:06 am
yer it is inserting more records than i thought actually i just thought that was down to my database structure. Any idea how i could solve this??
April 9, 2012 at 10:45 am
Ok so it has been SOLVED. Would like to thank all the people that helped. Below is the code that worked for me.
ALTER TRIGGER tg_UpdateTraining
ON Training
AFTER UPDATE
AS
BEGIN
INSERT...
April 9, 2012 at 10:35 am
No they are not called additionalcolumn, the one is the staff_No and the other is the primary key of the trainingHist table (trainingHist_No) so yes I think the join with...
April 9, 2012 at 8:33 am
Im thinking of doing something like the below
CREATE TRIGGER tg_UpdateTraining
ON Training
AFTER UPDATE
AS
BEGIN
INSERT INTO trainingHist
(
AdditionalColumn1,
AdditionalColumn2,
...
April 9, 2012 at 8:21 am
I building a c# windows application and trying to use the trigger to put the old data into the traininghist table. The error im recieving from visual studio is 'Conversion...
April 9, 2012 at 5:43 am
sorry i knew that it should be from DELETED forgot to upload new version but yes still does not work
April 8, 2012 at 12:36 pm
SOLVED!!
I have reformated the dates in my table and used the below query and it worked 🙂
SELECT *
FROM v_stafftrainingDetails
WHERE (expiry_Date >= DATEADD(dd, DATEDIFF(dd, 0,...
April 3, 2012 at 2:25 pm
Also I have just realised my data in the tables is MM/DD/YYYY where when i just did
Select GETDATE()
the results were
03/04/2012 21:11:04
which is
DD/MM/YYYY
April 3, 2012 at 2:13 pm
Below are my create table, insert into (5 of each) and the create view statements. Ive also provided a database diagram to give more idea. Hope this helps
CREATE TABLE staff(
staff_No...
April 3, 2012 at 2:08 pm
I'm using visual studio 2010 with sql server 2008 express this might be why??
April 3, 2012 at 1:46 pm
Results are -
expiry_Date Expr1
09/12/201210/12/2012
10/11/201211/11/2012
09/12/201310/12/2013
22/10/201323/10/2013
10/12/201311/12/2013
29/08/201330/08/2013
11/01/201212/01/2012
30/10/201131/10/2011
28/10/201029/10/2010
09/02/201210/02/2012
April 3, 2012 at 1:36 pm
This is what I tried
SELECT *
FROM v_stafftrainingDetails
WHERE (expiry_Date >= DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)) AND (expiry_Date < DATEADD(dd, DATEDIFF(dd, 0, DATEADD(dd, 60, GETDATE())) +...
April 3, 2012 at 1:15 pm
it must include 06/02/2012 aswell so im presuming a <= sign somewhere. And no they do not have time component. I will make sure I read that paper and make...
April 3, 2012 at 1:07 pm
So any date from now up until 60 days. 1 to 60 days from now so from today (04/03/2012) to (06/02/2012) and display all data inbetween those 2 dates from...
April 3, 2012 at 1:02 pm
Viewing 15 posts - 1 through 15 (of 20 total)