Forum Replies Created

Viewing 8 posts - 16 through 23 (of 23 total)

  • RE: Dates to quarters

    Thanks!

     

    SELECT TYPE,vendor,discontinueddate, datepart(quarter, GETDATE()) AS 'Quarter'

    from EOL

    WHERE (DISCONTINUEDDATE >= '01/01/2005')

    Order by discontinueddate

     

    works and returns the Current quarter but how do I change the GETDATE to cover all years 2005 and...

  • RE: Insert based on date

    Thank You!!! Yes that's the correct way and I missed it to during the creating of the table. Thinking to much. If you have the ONE date that's constant then...

  • RE: Insert based on date

    Insert into sunrise (Poc, Sunset, DateBefore, DateAfter) values (@Poc, @Sunset, dateadd(m, -6, Production), dateadd(m, 6, Production))

    Server: Msg 137, Level 15, State 2, Line 1

    Must declare the variable '@Poc'.

  • RE: Insert based on date

    hey I got you to 2K COOL!!!

    Yes one field is the one I need to pull the up or down dates from

    Production

     

    Thanks

     

    Mike

     

  • RE: Insert based on date

    I m still messed up

     

    Insert into sunrise (Poc, Sunset, DateBefore, DateAfter) values (@Poc, @Sunset, dateadd(m, -6, Datefield), dateadd(m, 6, Datefield))

  • RE: Insert based on date

     

    Simple insert

    INSERT INTO tbTest (field1, field2, field3, field4) VALUES ('1', '1', '1',

    '1')

     

     

  • RE: Insert based on date

    Just need to do one bult update on two fields

    POC is the 6 months older field

    Sunset is the 6 month newer

     

    Sorry I am super new to dealing with dates. ...

  • RE: Insert based on date

    Thank you !!! so would it be

     

    insert fieldname dateadd(m, -6, Datefield)

Viewing 8 posts - 16 through 23 (of 23 total)