471,107 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,107 software developers and data experts.

Extract datas

15
Good day,

I'm trying to extract some data from our database. I just need to get the list of persons that will be having 5 or 10 months on their contract this coming month.


Thanks in advance.
Sep 29 '07 #1
2 927
azimmer
200 Expert 100+
Good day,

I'm trying to extract some data from our database. I just need to get the list of persons that will be having 5 or 10 months on their contract this coming month.


Thanks in advance.
It is way too little information for us to help. Please include:
  • the structure of your relevant tables
  • a field-wise description of what you need
  • example, perhaps
  • the point where you've got by yourself
Sep 29 '07 #2
Motoma
3,237 Expert 2GB
How about:
Expand|Select|Wrap|Line Numbers
  1. SELECT
  2.     *
  3. FROM
  4.     tablename
  5. WHERE
  6.     DATEDIFF(MONTH, GETDATE(), datefield) = 5 
  7.     OR DATEDIFF(MONTH, GETDATE(), datefield) = 10
  8.  
Oct 1 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Bob Bedford | last post: by
reply views Thread by André Betz | last post: by
2 posts views Thread by DurumDara | last post: by
reply views Thread by napolpie | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.