Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    Unanswered: select Employees by start day for 8 month working

    hi there
    i have this column Sdate in my Employees table
    this value represent the start date working
    i need to get all of the employees that between 8 and 10 month of work from today

    how can i do it ?
    thanks ....

  2. #2
    Join Date
    Aug 2004
    Location
    Dallas, Texas
    Posts
    831
    Quote Originally Posted by dotnet.il View Post
    hi there
    i have this column Sdate in my Employees table
    this value represent the start date working
    i need to get all of the employees that between 8 and 10 month of work from today

    how can i do it ?
    thanks ....
    Use a date function like dateadd, datepart or datediff then write a SQL select statement with a where clause to filter the expected results.

  3. #3
    Join Date
    Jul 2013
    Posts
    2
    hi thanks for your answer
    maybe can u write me the query ?
    thanks...

  4. #4
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    This should get you started
    Code:
    SELECT Current_Timestamp
         , DateAdd(mm, -8, Current_Timestamp) As eight_months_ago
    Give it a try and if you get stuck post back your attempts and we'll give you pointers
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •