Computing.Net > Forums > Database > SQL statement comparing date

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL statement comparing date

Reply to Message Icon

Name: dougchiu
Date: January 13, 2008 at 19:51:43 Pacific
OS: Windows2000
CPU/Ram: 2
Product: 2
Comment:

May I ask if any sql statement to compare date with today and give the result on each record?
e.g
table
Date Name
8/1/2008 Tom
27/12/2008 Ann
24/6/2007 Sam
17/8/2007 May

Compare with today which more than 30 days
result
Date Name Morethan30d
24/6/2007 Sam Yes
17/8/2007 May Yes

Thank you for your help~!




Sponsored Link
Ads by Google

Response Number 1
Name: User123456789
Date: February 3, 2008 at 06:32:58 Pacific
Reply:

select DATE_COLUMN,NAME_COLUMN,"Yes" from TABLE where DATE_COLUMN < sysdate - 30;

Hi there.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: SQL statement comparing date

Beginner SQL Student, Question www.computing.net/answers/dbase/beginner-sql-student-question/271.html

sql syntax problem www.computing.net/answers/dbase/sql-syntax-problem/291.html

Combine 2 reports in SQL www.computing.net/answers/dbase/combine-2-reports-in-sql/378.html