Error restricting dates in SQL Server

Asked

Viewed 71 times

3

I get 3 databases that are mounted in different locations, these bases come to me in text file (.txt) and I import to SQL Server.

I’m making a query in which I want to restrict the records only for the year 2014 but even putting Data >= '01/01/2014' he continues to appear records from 2012 and 2013.

  • Wouldn’t be the date format you’re going through?

  • I thought about it, but I don’t know the current format, the . txts only come to me every day. But it’s a possibility.

  • Data >= '2014/01/01' must return the expected result.

  • Reduced from 1200 records to 600, and still has 2013 and 2012 kkkk

  • What kind of field in the comic book?

1 answer

2


Test that

YEAR(Data) IN '2014'
  • Thank you so much Lucas!! It worked!

  • You only get the right answer for those who have the same question.

  • Ready!!!!!!!!!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.