Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Filter Query By Year & change dated automatically
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 01/21/2014 :  12:34:24  Show Profile  Reply with Quote
Hello, I have a data column named Date_In with format of 20-May-13. How can I filter the data to select based on year only. I used



From apps.xdmc_852@erpprod

Where Year(Date_in) = 2014

This code is not working.

I also need a way to automatically update to next week range. For example, last week I used where function like this

Where Date_in = to_date('01/12/2014','MM/DD/YYYY')

Is there a way it will automatically at the next 7 days to the code above when the date is available. This week I have to go back and changed the code in to this:

Where Date_in = to_date('01/19/2014','MM/DD/YYYY')


Flowing Fount of Yak Knowledge

4614 Posts

Posted - 01/21/2014 :  13:48:37  Show Profile  Reply with Quote
Just to clarify, you have a column called Date_In and that column contain string values of dates formatted like DD-MMM-YY (20-May-13)?

If that is the case, do you have the option of changing that column to a proper date column? That would make like a lot easier.

Plus, it looks like you are using Oracle. This is a SQL Server forum, so you might get better help on a forum specific to Oracle.

Edited by - Lamprey on 01/21/2014 13:50:43
Go to Top of Page

Starting Member

2 Posts

Posted - 01/21/2014 :  13:54:11  Show Profile  Reply with Quote
Do you know any forums for Oracle?

Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 01/22/2014 :  07:25:21  Show Profile  Reply with Quote
Originally posted by tdnguyen

Do you know any forums for Oracle?



SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.27 seconds. Powered By: Snitz Forums 2000