Forum Replies Created

Viewing 15 posts - 1 through 15 (of 20 total)

  • RE: Update Trigger

    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,

    ...

  • RE: Update Trigger

    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??

  • RE: Update Trigger

    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...

  • RE: Update Trigger

    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...

  • RE: Update Trigger

    Im thinking of doing something like the below

    CREATE TRIGGER tg_UpdateTraining

    ON Training

    AFTER UPDATE

    AS

    BEGIN

    INSERT INTO trainingHist

    (

    AdditionalColumn1,

    AdditionalColumn2,

    ...

  • RE: Update Trigger

    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...

  • RE: Update Trigger

    sorry i knew that it should be from DELETED forgot to upload new version but yes still does not work

  • RE: DATEDIFF

    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,...

  • RE: DATEDIFF

    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

  • RE: DATEDIFF

    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...

  • RE: DATEDIFF

    I'm using visual studio 2010 with sql server 2008 express this might be why??

  • RE: DATEDIFF

    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

  • RE: DATEDIFF

    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())) +...

  • RE: DATEDIFF

    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...

  • RE: DATEDIFF

    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...

Viewing 15 posts - 1 through 15 (of 20 total)